Quantcast
Channel: polylang – WordPress.org Forums
Viewing all articles
Browse latest Browse all 11471

Alain Schlesser on "[Plugin: Polylang] Warning: Illegal string offset 'taxonomy' error!"

$
0
0

Hi,

This error comes from the new 'relation' query parameter that's been introduced by WP 4.1.

Here's an excerpt from the codex:

Taxonomy Parameters
Show posts associated with certain taxonomy.

{tax} (string) - use taxonomy slug. Deprecated as of Version 3.1 in favor of 'tax_query'.
tax_query (array) - use taxonomy parameters (available with Version 3.1).
   relation (string) - The logical relationship between each inner taxonomy array when there is more than one. Possible values are 'AND', 'OR'. Do not use with a single inner taxonomy array.
      taxonomy (string) - Taxonomy.
      field (string) - Select taxonomy term by ('term_id'(default), 'name' or 'slug')
      terms (int/string/array) - Taxonomy term(s).
      include_children (boolean) - Whether or not to include children for hierarchical taxonomies. Defaults to true.
      operator (string) - Operator to test. Possible values are 'IN'(default), 'NOT IN', 'AND'.

Important Note: tax_query takes an array of tax query arguments arrays (it takes an array of arrays). This construct allows you to query multiple taxonomies by using the relation parameter in the first (outer) array to describe the boolean relationship between the taxonomy arrays.

So, any plugin or theme could use this functionality now. The Warning appears because the 'relation' parameter is not an array, it is a simple string.

I think that the plugin using this on my site is Views by onTheGo Systems.


Viewing all articles
Browse latest Browse all 11471

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>