I figured it out, meta_query must be an array within an array as it is intended for advanced queries using ‘relation’.
meta_query => array (
array (
//'relation' => 'OR',
'key' => 'audio_file', //The field to check.
'value' => '', //The value of the field.
'compare' => '!=', //Conditional statement used on the value.
),
),
The conditional ‘!=’ not-equal to ” (null) returns true if a file has been uploaded.
Related Posts:
- How to do a meta query using REST-API in WordPress 4.7+?
- Meta query terribly slow
- meta_query sorting by 2 keys
- Get result from meta_query() between two numbers
- How to handle optional end date in compare clause in meta_query
- Using meta_query on pre_get_posts to exclude a particular meta_key value
- Best practice – Meta Query vs. post_clauses for “left join” ordering
- Different page parameters inside query
- Return posts with specific meta key first, but the rest in alpha order by last name
- meta_query key value from array
- LIKE %…% Meta Query
- Order by nested named meta queries with ‘exists’ and ‘not exists’
- Documentation for post meta
- Arrange Posts By Date In Order Of Closest To The Current Date
- Custom Upcoming Events List for Events Manager Plugin
- How to exlude posts that have certain meta_value?
- User Relationship
- WordPress Core – Optimizing meta_query generated SQL?
- Edit post_content on posts with Featured Image
- Use both meta query and tax query
- meta_query, number comparison, not quite working as it should
- Meta Query Compare with Date
- Query posts only if meta_value is not empty
- Does meta_query working with value paramater higher then 999?
- meta_query keys and sticky posts
- How to pass user meta_key and meta_value (values as array)
- meta_query compare=’!=’ with multiple custom fields
- Query posts with numeric meta values within a given range
- Fastest way to do meta query when I don’t need the actual posts, and just need post_id?
- meta_query not working on live site
- How to query post only with different excerpt?
- How do you get Posts by multiple meta_keys and meta_values with the Rest API V2?
- Meta query with regular expression does not work
- WP User Query Issues
- How to use meta query for greater than value in array?
- Wp Query custom search by meta query
- Filter posts by meta query?
- Help on multiple meta_query
- Meta query – How to display a null meta key
- pre_get_posts and set
- Meta query date column add [x] days to validate
- How to use orderby with meta_query?
- Orderby doesn’t work like expected on custom query
- last_name + first_name orderby with meta_query [solved]
- Extend meta query arguments
- get_posts( $args ) return empty data
- how to get post meta where value is an array of key value pairs
- Meta Query Based on Month Range
- how to search all user meta data that have value like “vivek”
- Find posts by related taxonomy field
- wordpress meta value compare between two date
- Can I use pre_get_posts to add up values from two different meta_keys?
- WP JSON API meta_query not working
- get_users with Serialized Custom Meta Value
- Sorting posts by ACF field
- Ordering custom posts by meta field date
- latitude/longitude meta_query
- meta_query displays all results and none, my query is wrong
- How to properly escape values in meta query
- Delete all posts with a specific custom field using meta_query
- Fetch custom post related to a User
- How to Ordering by user meta
- Use meta_query in args for relationship
- meta_query Array
- meta_query compare “=“ returns nothing when it seems it should
- Order resultset by configured value and then list all the rest
- Issue with user meta_query
- How to get an archive page meta?
- Search for value(s) in meta field for a multi select
- Querying terms with calculations based on term meta data, sql vs. get_terms
- How can I create a meta_query with an array of dates?
- WordPress meta query not working
- Get meta_value from GDRating
- WordPress meta query with meta serialized data array value
- wordpress meta query with multiple meta condition causing a load on server and slows down the server..!
- Why does this incorrect pre_get_posts meta_query work for sort order?
- How to sort custom posts including null meta-values in admin columns with meta_query?
- Memory Leak in Processing Large JSON file
- meta_query not filering but meta_key works fine
- get posts meta query returning the latest post if no meta key found
- WordPress search between two newmeric values with a custom post type
- WP User Query with meta queries
- Search using specific meta fields only (excluding post title and content)
- How to fetch WP_User_Query with multiple role arguments [duplicate]
- How to get meta value based on latest post id with group by term name
- Meta query not returning results even though the sql contains the information
- Display Users from two roles in one list
- WP_Query with UNIX timestamp in meta query
- Querying by meta key and value
- Multiple Queries with meta_query
- Get foreach for meta_query value
- Sort posts by post views and consider meta key
- Meta query “OR” comparison not working as expected with array
- order by meta_key [duplicate]
- WordPress Meta Query very slow with NOT EXISTS comparison
- ACF meta_query field treated as “0” resulting in false negative search when testing ranges
- Is it possible to customize meta query in this way?
- Ordering WP_Query results by second meta_key
- How making a new search box in admin post table working on a specific column
- wp_user_query with meta_value_num for leaderboard