[wp-hackers] Problem: WP_Query() with custom field value as an array ...

wpmidia lab wpmidia at gmail.com
Mon Nov 14 17:17:15 UTC 2011


hello people!

How could I do my query (using WP_Query() class), if my custom field value
is stored as an array?

for example:
a:2:{i:0;s:3:"183";i:1;s:3:"182";}

$args = array( 'post_type' => 'MY_POST_TYPE', 'posts_per_page' => 10,
'order' => 'ASC', 'meta_key' => 'MY_KEY', 'meta_value' =>
'MY_META_VALUE_ARRAY' );
$loop = new WP_Query($args);

I need to check if a ID is stored in this array, to proceed my query ....

Somebody help me?


thanks!

-- 
*Míriam de Paula *
*(a.k.a. Drika)*
*Twitter:* @miriamdepaula

wp*midia*
*desenvolvimento web*
http://wpmidia.com.br
twitter: @wpmidia

*WordPress Brasil no Facebook: *
http://www.facebook.com/groups/wordpress.brasil

*OpenCart Brasil no Facebook:*
http://www.facebook.com/groups/opencart.brasil/


More information about the wp-hackers mailing list