-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
bugSomething isn't workingSomething isn't working
Description
If a WP query has a meta query with a key that is not found in any of the posts, found posts value is incorrect. For example, if a post type is set for the query and a meta key is not found in any of posts for the post type, found posts equals to the number of posts in the post type. This might be Polylang related, since this happened on a site with Polylang activated. The number of found posts was equal to the number of all posts in all of the installed languages.
Steps to reproduce:
- Install and activate Polylang Pro
- Create a post type and publish posts for multiple languages
- Do a WP query with a meta query for a missing post meta key
Example of the used WP query args:
$args = [
'post_type' => 'my_custom_post',
'posts_per_page' => 10,
'paged' => 1,
'order' => 'ASC',
'orderby' => 'meta_value',
'meta_key' => 'my_missing_meta_key',
];
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working