• ResolvedPlugin Contributor Grégory Viguier

    (@greglone)


    Hello Chouby.

    I think I found a bug in your method PLL_Frontend::parse_query().
    You do not filter the query if a tax query is set, and I understand why, BUT, there’s a case where you should : 'operator' => 'NOT IN'.

    So, inside your foreach loop:

    if (isset($tax[‘taxonomy’]) && ‘post_format’ != $tax[‘taxonomy’])

    should be:

    if ( isset($tax[‘taxonomy’]) && ‘post_format’ != $tax[‘taxonomy’] && ! ( isset($tax[‘operator’]) && ‘NOT IN’ === $tax[‘operator’] ) )

    Bye.

    https://wordpress.org/plugins/polylang/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Chouby

    (@chouby)

    Hi Greg!

    I believe that I see what you mean. I will change this code in v1.7 to for the compatibility with nested queries introduced in WP 4.1. Can you share a use case?

    Plugin Contributor Grégory Viguier

    (@greglone)

    Hi there 🙂

    Sorry for the delay, busy period…
    I was trying something like this:

    new WP_Query(
        'tax_query' => array(
            array(
                'taxonomy' => 'poney',
                'field'    => 'slug',
                'terms'    => array( 'pink' ),
                'operator' => 'NOT IN',
            ),
        ),
    );

    In that case we can have terms in a wrong language.

    Plugin Author Chouby

    (@chouby)

    I have introduced the fix in Polylang 1.7 beta (in a slightly different way as I needed to fix the nested queries too).
    https://downloads.wordpress.org/plugin/polylang.beta.zip

    Plugin Contributor Grégory Viguier

    (@greglone)

    Great 🙂
    I won’t be able to try out the beta, the website is online now (it was for a client).
    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘tax_query bug’ is closed to new replies.