You may be able to use the LIKE
operator:
$meta_args[] = array(
'key' => 'availability',
'value' => $availability,
'compare' => 'LIKE'
);
In the codex you can see a list of comparison operators.
Related Posts:
- Meta query with string starting like pattern
- compare meta_query in get_posts arguments
- Getting attachments by meta value
- querying with custom meta field with meta_query
- Order by meta_value_num DESC and meta_value ASC on WP 4.0
- WordPress altering my custom query, How to fix it?
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- Order by meta_key in custom post type doesn’t affect the query
- meta_key and meta_value not working together
- Order Posts by meta value AND published date
- How to make Meta Query case sensitive?
- Fetch Record based on meta key dates
- Meta_query with multiple keys and multiple values
- meta_query BETWEEN, but the range is stored in the custom field
- Extend product search with meta in WooCommerce
- how to make members list directory through wordpress post custom meta key.
- Large AND OR query timing out
- meta_value_num not ordering all items
- meta_compare not comparing whole integer
- Display posts with specific value first in query
- Get every post with value in meta key
- add_query_arg to compare and display events from a certain date
- Comparing 2 Decimal Numbers from custom fields and displaying posts
- meta_query weird behaviour, static int will work, but not user data
- Query multiple post types, but different order for each
- Order by the first array within a meta_query
- Query ACF relationship field – Comparator IN – Value array
- ACF: How to query for a given value count of an array like field? (e.g.: How many rows has a `flexible_content` field?)
- How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
- How do i create a custom post query when the meta value is an array?
- WP Query – grouping posts by same meta key, adding together values from another key
- meta_query is overriding default search
- Trouble with serialized metadata
- Comparing Meta Field date in WPQuery using Meta_Query?
- Getting posts by custom field value
- Query against multiple locations within single custom post type post
- WP_Query, ACF field and array
- Order by Date Custom Field
- Query by meta value (add a dropdown of all values)
- Order Posts By Custom Field That is an array of objects
- Custom WP_query and integrating into theme file
- Using custom field as ‘orderby’ value causing post grouping by publish date
- query post based on comparison
- Get posts by meta value except one post [closed]
- Can wp_query return posts meta in a single request?
- Display products from specific category in shop page
- Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
- Meta Query with AND & OR?
- meta_query where value is equal to given value
- Query by meta_key and order by meta_value_num return orderby date
- Comparing timestamps in meta query doesn’t work
- How to create/modfiy WP_Query to search in post title OR custom field?
- Multiple meta queries but arrange by specific meta value order
- What format does the meta_query TIME type require?
- wp_query add arguments using array_push if variable met
- pre_get_posts order by not working
- Group WP_Query by meta_key date
- WP_Query filter and order by meta ordering by wrong joined table
- WP_Query last five posts, simply ordered by meta_value
- What is the random string I am seeing when I use get_query_var?
- Orderby is working with one query but not with other
- meta_query in WP_Query value is not accepting array
- Adding multiple meta_key fields as orderby options to a WP Query via a function
- Changing sort order for presentation by Jetpack infinite scroll
- get posts by meta_key from inside key of post meta
- Help optimizing slow WP_Query with meta_query
- Meta Queries – should nesting work after WP 4.1?
- Filter and Order by Multiple Custom Meta Values
- Meta Query relation “AND” then set array accordingly
- Meta Query And/Or
- Query with meta_query and tax_query together not working properly
- Is it possible to query a custom field where the value is between two fields?
- Filter posts by comparing custom meta value against postdate
- WP_Query Meta_key is text value and need to sort as numeric not working
- filter wp_query result with custom field values
- meta_query fails to compare on values containing apostrophes
- Check if searched number is within the post meta value
- WP_Query not returning correct result with meta_query parameter
- Query on meta values and post title
- Custom Meta Query doesn’t work the same on two site
- Retrieve all custom field values of a specific custom field metakey as an array, inside WP_Query
- Query for current post
- Custom query to retrieve oldest post and retrieve others with date interval
- Very slow query generated getting meta data from posts
- Order 2 meta_queries differently in WP_Query?
- Order posts by title and custom field value?
- Slow wp_posts and wp_postmeta query using Advance Custom Fields
- Meta_Query refuses to return results
- List users by Year of Birth using a foreach loop to dynamically populate years and data
- What is the best way to reset a search on a meta_key / meta_value?
- Slow query when selecting with large meta query or post__in
- WP Meta Query at depth 2
- Query events post type after current date and timezone
- Sorting posts by meta values: 2 different orders
- Sorting Posts with meta value not working
- Looking for a way to exclude frontpage and nav menu from query filter
- WP_Query by meta key not returning any posts
- WordPress extremely slow when using get_posts with multiple meta_query relations
- Use value from meta key array for use in WP_Query
- WP_Query sort by ACF date field (newest first) with blank dates first