Skip to content

Warmup post languages in WP_Query #138

Open
@goncaloasimoes

Description

@goncaloasimoes

When a WP_Query fetches X amount of posts. If there is a processing in the frontend of the queried posts to fetch their permalinks, each of them will have their language fetched. LangInterface::get_post_language has a transient, but if there is no transient for the posts, there will be a lot of different separate queries to get each post's language.

In order to combat this, upon a successful WP_Query for posts, we can warmup these transients with the post languages by doing one query for all of them.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions