I am doing a very simple WP_Query:
$query = new WP_Query([
'pagename' => 'some-post-slug',
'suppress_filters' => true // used by WPML to search in ANY language
]);
However, the query that is performed is:
SELECT wp_posts.*
FROM wp_posts
WHERE 1 = 1
AND ( wp_posts.id = '0' ) // notice this line
AND wp_posts.id = 171073
AND wp_posts.post_type = 'post'
ORDER BY wp_posts.post_date DESC
Why is ( wp_posts.id = '0' )
returned? If I remove it from the query, then the page is found without any issues.
Sidenote: Also strange that it searches by wp_posts.id = 171073
when I defined a post_name.