You don’t have any conditions for “any” as a given value in your code, so it won’t be treated as any, but as “any”.
But your code checks if given value is not empty, so passing it like so should work:
api.php?key=fruit,drink&value=,whiskey
PS. I’m not sure if that’s the best way of passing arguments to your api 😉
Related Posts:
- WP_POSTMETA – What do these values mean inside the data structure?
- I can not display meta value in extras.php and template-tags.php
- Negative meta_query if storing multiple post_meta values with shared meta_key
- How to get posts by meta value as multi-dimensional array?
- How to extract data from a post meta serialized array?
- Meta compare with date (stored as string) not working
- How to get all term meta for a taxonomy – getting term_meta for taxonomy
- How to update single value in multi dimensional Post Meta?
- How to store post meta in an array?
- WP Meta Query for some meta (array) values
- How metadata API works?
- Job of meta_key meta_value fields in database tables
- order by multiple meta_keys?
- How to get the total number of meta_values based on a custom post type?
- How to stop wp_postmeta from being called on archive and search pages?
- get_*_meta doesn’t always return an array
- Run a check for multiple meta key values
- Unset field from an array not working as expected
- How can I convert postmeta from unserialized to serialized?
- How to create a meta_query to get all posts with a specific meta data?
- Compare meta_query with a Regular Expression and do a less-than operation on it
- $wpdb class updating meta_value using Ajax [closed]
- Post meta as array looks like string instead of array
- Grouping posts by a custom meta value
- Time & Date on Post – Time Ago Custom Function
- Should I save this mulit dementional arary as one post meta?
- How to check if a post meta key/value pair already exists for a specific post
- Can A Post Meta Field Store multiple values that are not in an array?
- Order by meta value pro first then meta value free in my search function
- why after saving meta value it’s saving all the values the one that i clicked?
- change order of images attached to post
- Print specific values stored in a post meta array
- Is it safe to add a new field to meta_value field?
- How can I use ‘orderby’ => ‘meta_value_num’ to order by the numerical value even if the value starts with a word?
- Array of user ids to list of user names
- get Insert id for meta field
- Filter posts by meta key
- Display current ranking of post as a number in post title
- Search post overlapping dates – meta_query with meta_key
- How can I query for posts using a date stored in post-meta?
- update_post_meta() updating nested array in Multidimensional array with empty sub-array
- Count Post and Page Views based on meta_value Using Shortcode in Dashboard Widget
- How can I update this array built from post meta data?
- What format is this and how to get value “lal” and “pila” from it
- if get_post_meta function returns empty – Do Not Display HTML
- Trouble with serialized metadata
- How to get the total of two meta values from different meta keys?
- How to save a meta_value as a numeric value after I retrieve it via update_post_meta?
- How to update/add child posts meta whenever the parent post meta is updated?
- Combine meta query and give a specific meta query a higher priority
- WordPress meta query with meta serialized data array value
- Reading Content in an Array as it relates to a meta_query
- Optimize WP Meta Query for large amount of post meta?
- Multiple postmeta values to the same post_id/meta_key combination?
- How to sort by meta value num, but ignore zero value?
- Plugin Shortcode value in post
- Retrieve posts from meta key
- Fetching array of postmeta with $wpdb and in_array conditional
- How to show specific meta keys of all posts in admin panel?
- How to create a link for wordpress meta datas?
- wp_postmeta store multiple values in one key [closed]
- How we insert values into database using metabox WordPress?
- Check for custom field value in different post type than current one and do something
- WP Query Args – search by meta_key or title
- Update post meta array – add new, single value
- Saving zero as meta value
- Get a row from a separate table by matching a posts meta_key to a tables ID column
- Reset/delete post views meta/custom field after X hours or minutes or seconds
- Have lots of meta for posts, is it better to get at all at once or each individually
- IF Custom field value equals ZERO
- Query posts WITHOUT a custom meta field
- Add box with custom per-page properties
- get_post_meta not working when variable used for post ID
- Update post meta dynamically
- Need a SQL query to update meta_key=’_price’ with value in meta_key=’_regular_price’
- Display current user’s custom post meta in sidebar
- add_post_meta doesn’t work
- How to get single value from get_post_meta() array of values?
- wordpress update multiple posts post meta
- get_template_part() isn’t loading author information
- WP_Query meta compare must include ALL array values
- Format meta_value [closed]
- wp query to use both author id and meta_query
- URL from get_post_meta() is broken my URL
- Custom Meta Box: Value saved in WordPress DB, but not shown in input field on Edit Screen
- get_post_meta and add_post_meta not working
- Export media library with metadata and import into new blog
- Trouble with calling an imploded variable in an array
- Why doesn’t wp_oembed_get() for the video post format not work?
- Custom Meta Fields that are Echo’d are removed on post update?
- How to add dynamic content in title and meta description in wordpress theme for homepage, post page, category, tag and pages
- add_post_meta only adding 1 character
- How to get several fields from wp_query?
- Posts with no meta field do not appear when sorting by meta field
- query with custom field
- Using Form to alter PHP variable [closed]
- Chance post id into post name
- Multipe array in meta_input
- getEntityRecords/useEntityRecords: How to use CPT metadata?
- How to update post view count?