WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] What is the problem? (2 posts)

  1. theal3x
    Member
    Posted 1 year ago #

    $args = array(
    'meta_query' =>	array(
    array('key' => array('keyone', 'keytwo'),
    'value' => 'somevalue')
    )
    );

    Warning: trim() expects parameter 1 to be string, array given in (...)

    ?

  2. jdak
    Member
    Posted 10 months ago #

    I second this problem.

    $args = array(
       'post_type' 		=> $post_type,
       'category__and'  => $filters, //filters array
       'meta_query' 	=> array(
           						array(
           						    'key' => 'product_category_filter',
           						    'value' => $category_ids, //array
           						    'type' => 'numeric',
           						    'compare' => 'LIKE'
           							)
           						),
    
    );
    
    $filtered_search = new WP_Query($args);

    Warning: trim() expects parameter 1 to be string, array given in ...

    I've tried other compare values: '=', 'IN', and 'EXISTS' as well.

    I'm basically using the same code as from the documentation

    Sorry, I can't post a link to the site, it's under development.

    Any help would be appreciated! Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic