• Took me a while to find the problem but it seems that polylang is filtering the database query string used by WP_Query. This is just wrong. These low level functions should not be tampered and at least should have an option on the settings page.

    I have a simple query:
    WP_Query( array( 'post_type'=>'page', 'author'=>$curr_user ) );
    The intention is (as you guessed) to return all pages written by that user. But, due to the filtering, only pages marked with the current language are returned. I suggest the filtering take place somewhere else as this is going to break other plugins that rely on these functions.

    https://www.ads-software.com/plugins/polylang/

Viewing 1 replies (of 1 total)
  • Plugin Author Chouby

    (@chouby)

    I suggest the filtering take place somewhere else as this is going to break other plugins that rely on these functions

    ‘pre_get_posts’ is used. Which other filter would you suggest?

    To get all languages, you can rewrite your query as below:

    WP_Query( array( 'post_type'=>'page', 'author'=>$curr_user, 'lang'=>'' ) );

Viewing 1 replies (of 1 total)
  • The topic ‘wp_query results’ is closed to new replies.