How to use meta query for greater than value in array?
How to use meta query for greater than value in array?
How to use meta query for greater than value in array?
WP User Query Issues
There is no official documented list of all possible post meta keys in core. The closest I could for anything unofficial was this answer on Stack Exchange: You probably don’t want to use the following post meta keys: _thumbnail_id – Used to store the featured image ID _edit_last – Used by the Heartbeat API _edit_lock … Read more
Your code looks correct. Have you checked your stored meta data to confirm the value stored is 1? Also, have you tried comparing to a string value, eg ‘1’ instead of 1? Just a stab in the dark, but worth a shot. Assuming your stored values are correct, and seeing as the values can only … Read more
Searching in title or meta, with a tax query too!
Meta query with regular expression does not work
According to the relevant article on the WordPress Codex, you should be able to add a type argument to the meta array. Resulting in something like this: $meta_query = array( array( ‘key’ => ‘date-available’, ‘value’ => date(“m/d/Y”), ‘compare’ => ‘<‘, ‘type’ => ‘DATE’ ), ); It’s worth noting, though (as Gopalakrishnan18 mentioned), MySQL expects a … Read more
You can hook into the rest api query and add your args from url’s parameters The code will look something like: function query_post_by_fields($args, $request) { $url_params = $request->get_param; //Modify $args with your url params return $args; } add_filter(‘rest_post_query’, ‘query_post_by_fields’, 10, 2); Docs: https://developer.wordpress.org/reference/hooks/rest_this-post_type_query/
How to query post only with different excerpt?
My reputation is too low for me to comment so I’ll do it this way. Make sure that the date format inside ‘value’ is the same as the date formats inside the database fields. Also don’t forget to add the ‘type’ => ‘DATE’ to your query. An example of some code that I’ve used in … Read more