Support

Account

Home Forums General Issues WP_Query … condition statements … now getting trim errors… Reply To: WP_Query … condition statements … now getting trim errors…

  • This is extremely odd, when you try to use “IN” WP does not detect that there is an array stored in the field, it’s looking for multiple meta value rows in the database. When you attempt to have WP treat it as a string with “LIKE” it then decides to detect that there is an array (serialized) stored in the field.

    WP has been doing some work on the meta queries to allow for the new clauses for meta_query https://make.wordpress.org/core/2015/03/30/query-improvements-in-wp-4-2-orderby-and-meta_query/

    Try forcing the field type to “CHAR”

    
    			
    			array(
    				'key'	  	=> 'banner_cats',
    				'value'	  	=> $pagecategories,
    				'compare' 	=> 'LIKE',
    				'type'		=> 'CHAR',
    			),