Support » Plugin: Polylang » PHP error when using multiple taxonomy queries

  • Resolved brian1037

    (@brian1037)


    In this example,


    $news_posts = new WP_Query(array(
    'post_type' => 'post',
    'posts_per_page' => 5,
    'tax_query' => array(
    'relation' => 'AND',
    array(
    'taxonomy' => 'article-format',
    'terms' => 38,
    'operator' => 'NOT IN'
    ),
    array(
    'taxonomy' => 'article-format',
    'terms' => 68,
    'operator' => 'NOT IN'
    ),
    )
    ));

    This query seems to work, but polylang will still produce an error like this:

    Warning: Illegal string offset ‘taxonomy’ in /home/…/wp-content/plugins/polylang/frontend/frontend.php on line 88

    Removing the line ‘relation’ => ‘AND’ will stop the error, but I need that line 😉

    Thanks!

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

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP error when using multiple taxonomy queries’ is closed to new replies.