• I have a custom post_type and a custom taxonomy. When i do get_posts() with this parameters:

    array(
    	'order' => 'ASC', 
    	'orderby' => 'meta_value', 
    	'meta_key' => 'order',
    	'post_type' => 'descriptions',
    	'category_name' => '',
    	'tax_query' => array(
    		array(
    			'taxonomy' => 'pages',
    			'field' => 'slug',
    			'terms' => 'desc_page_wine_ru'
    		)
    	),
    	'meta_query' => array(
    		'relation' => 'AND',
    		array(
    			'key' => 'city',
    			'value' => 'mow',
    			'compare' => 'LIKE'
    		)
    	)
    )

    – then i get a warning: Illegal string offset ‘post_type’

    Here is stack trace:

    wp-content/plugins/polylang/include/filters.php:138
    PLL_Filters->get_pages()
    wp-includes/class-wp-hook.php:287
    apply_filters('get_pages')
    wp-includes/taxonomy.php:874
    get_term()
    wp-includes/class-wp-term-query.php:1019
    WP_Term_Query->populate_terms()
    wp-includes/class-wp-term-query.php:838
    WP_Term_Query->get_terms()
    wp-includes/class-wp-term-query.php:288
    WP_Term_Query->query()
    wp-includes/class-wp-tax-query.php:637
    WP_Tax_Query->transform_query()
    wp-includes/class-wp-tax-query.php:562
    WP_Tax_Query->clean_query()
    wp-includes/class-wp-tax-query.php:394
    WP_Tax_Query->get_sql_for_clause()
    wp-includes/class-wp-tax-query.php:324
    WP_Tax_Query->get_sql_for_query()
    wp-includes/class-wp-tax-query.php:274
    WP_Tax_Query->get_sql_clauses()
    wp-includes/class-wp-tax-query.php:250
    WP_Tax_Query->get_sql()
    wp-includes/class-wp-query.php:2122
    WP_Query->get_posts()
    wp-includes/class-wp-query.php:3432
    WP_Query->query()
    wp-includes/post.php:2050
    get_posts()
    wp-content/themes/citypubcrawl/include/html.php:26
    show_category_html()
    wp-content/themes/citypubcrawl/blocks/_description.php:47

    I found that PLL_Filters->get_pages() always get string “pages” in $args parameter instead array

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Getting string in $args instead array in PLL_Filters->get_pages()’ is closed to new replies.