Linked Questions

0 votes
0 answers
30 views

How do I check if a NESTED ARRAY meta value array contains an item name? [duplicate]

I'm adjusting an archive page to only show products where a certain ACF meta field has a specific value but its not straight forward as the meta value is a nested array so I'm struggling to check if ...
DonnyDev's user avatar
6 votes
3 answers
34k views

WP Query post meta value

I'm trying to get posts which have applied the meta value trainees. $args = array( 'posts_per_page' => -1, 'orderby' => 'post_date', 'order' => 'DESC', '...
pbaldauf's user avatar
  • 372
1 vote
1 answer
5k views

Custom Field Query - Meta Value is Array

I'm using a custom field query (or trying to) : $args = array( 'post_type' => 'pf_cookbook', 'meta_query' => array( 'key' => 'pf_cookbook_recipes', ...
Cristian's user avatar
  • 1,375
1 vote
1 answer
4k views

Meta query with JSON value

Im using post meta to store some value. Im having the following in wp_postmeta table: meta_key mykey meta_value a:2:{i:0;s:1:"5";i:1;s:1:"2";} I need to return posts which have meta_value of 2. ...
RhymeGuy's user avatar
  • 147
2 votes
1 answer
3k views

order by meta_value serialized array

Hi I'm trying to pull posts using the wp query. Just one problem--I am trying to sort the posts alphabetically by a certain meta_value. Thing is that this meta_value is a serialized array. Is there an ...
KT.'s user avatar
  • 153
1 vote
1 answer
978 views

Filtering by Post Meta Custom Fields - Performance

I could use some advise on how to structure my data for performance. I have a custom post type with a lot of custom meta data stored in the wp_postmeta table as a serialized array under one meta key ...
Dominic P's user avatar
  • 685
0 votes
1 answer
1k views

Can serialized arrays in DB be matched against serialized arrays with meta_query?

Say I have an array of checkbox choices associated with a post (a custom field) stored in the database in serialized form. On my site, I present users with the same checkboxes and let them make their ...
Doggie52's user avatar
  • 182
0 votes
1 answer
2k views

WP Meta Query for some meta (array) values

If I get my posts using meta_query by 'my_meta_key' only I get something like this Array( [0] => Array( [nested_key1] => something_I_want1 [nested_key2] => ...
jave.web's user avatar
  • 477
0 votes
1 answer
2k views

how to get post meta where value is an array of key value pairs

I am trying to get the post meta with meta query where value is an array of key value pairs. $user_id = '123'; $arr = array(); $arr['a'] => "somevalaaa" ; $arr['user_id'] => $user_id ; ...
Nick Taylor's user avatar
0 votes
0 answers
974 views

WP_Query: Meta_Query with serialized value (or a workaround)

I have a post type Issue, that has meta values in form of associative arrays (that are saved as serialized strings to database). They look somewhat similar to this: [article_reviews] => Array (...
Petr Cibulka's user avatar
0 votes
2 answers
527 views

WP_Query Posts by Metadata from Option Tree

I am doing a WP_Query trying to filter out the posts by Metadata. $args = array( 'ignore_sticky_posts'=> 1, 'post_type' => 'post_projects', 'post_status' => 'publish', ...
lawdawg's user avatar
  • 51
2 votes
1 answer
444 views

How to customize user search

I'm developing a custom user search and I'm using this plugin found here: <?php function sul_user_listing($atts, $content = null) { global $post; extract(shortcode_atts(array( "...
DamianFox's user avatar
0 votes
0 answers
389 views

How to do a sql like query on serialized data of user meta data

As long I don't need to do a query with the data of all users, storing data like the zip code or city in the meta data as an serialized object works fine. But now I have to do a lot of different ...
Tom's user avatar
  • 13
0 votes
0 answers
387 views

Get closest event where meta_key field is an array

I have a custom post type called "Event", which contains a repeatable date field _cmb2_date . I have a function which prints out posts: function post_style_6($args) { global $post; $the_query ...
5ulo's user avatar
  • 121
0 votes
0 answers
41 views

meta_query - check for multiple meta values in key which holds an array of values

In my application, I have two custom post types: 'session' and 'speaker'. For the 'session' post type, I have added a custom field '_session_speakers' which stores an array of one or more 'speaker' ...
mcarlson64's user avatar

15 30 50 per page