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 ...
user avatar
4 votes
3 answers
27k 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', '...
user avatar
  • 332
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', ...
user avatar
  • 1,355
1 vote
1 answer
3k 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. ...
user avatar
  • 147
2 votes
1 answer
2k 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 ...
user avatar
  • 153
1 vote
1 answer
911 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 ...
user avatar
  • 675
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 ...
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] => ...
user avatar
  • 407
0 votes
0 answers
948 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 (...
user avatar
0 votes
1 answer
593 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 ; ...
user avatar
0 votes
2 answers
475 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', ...
user avatar
  • 51
2 votes
1 answer
340 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( "...
user avatar
  • 133
0 votes
0 answers
337 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 ...
user avatar
  • 121
0 votes
0 answers
210 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 ...
user avatar
  • 13
1 vote
1 answer
30 views

Fetch Record based on meta key dates

I want to write a query which fetches the data based on my meta key added. Meta key name is 'repeater'. This is my POST META. Serialized: a:3:{i:0;a:3:{s:9:"postdates";s:10:"2021-02-02&...
user avatar

15 30 50 per page