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]
- How to get products with the same custom attribute like ean code
- Nested meta_query with multiple relation keys
- Sorting posts by custom date fields (non standard date format)
- Query Multiple Post types each with own meta query
- ACF datepicker meta_query Compare Dates in m/d/Y g:i a – Not in Ymd Format
- Query two post types and order by two different date fields
- WP Meta Query for some meta (array) values
- meta_query with array as value
- Using OR in WP_Query negates the “NOT EXISTS” compare
- Using WP Query to search within ALL keys in meta query
- WP Query – Get WooCommerce Products with variation that is in stock
- Meta_query with or without value
- How can i make WP_Query return post image and categories?
- How add a custom posttype name using ACF field to a query post array
- wp_query not searching with apostrophe
- Custom query based on meta key – Reduce three states to two in results?
- Add quicklink to in the Admin posts page where I can query by a meta_key
- Performance when getting post meta for post retrieved by meta value
- How to display multiple custom fields with the same meta_key in an ascending order?
- Order by empty custom field
- Tax query AND/OR meta query [duplicate]
- Help ordering Post loop by two meta values
- Query all posts if multiple meta key don’t exist
- wp_query to print posts if have X custom field value
- Why is WP_Query not displaying expected data?
- meta queries do ‘either/or’ checks
- WP Query ordering on a meta field for posts with a date in the future not ordering by datetime
- Selecting posts with a given meta value for a meta key
- WP_Query: getting posts where custom field exists
- How to order posts on each different category?
- Using get_posts to get posts based on a checkbox value with Advanced Custom Fields
- get_page meta query not working, maybe a bug?
- Query by date from custom field
- Sort posts using multiple custom fields and menu_order in single query?
- Sort custom post by custom field if none order by latest release
- Order (by ASC) posts with meta_key so posts without values are last
- show most viewed post
- Why can my filter query SOME metadata but not other metadata?
- wordpress multiple meta value query is not working
- Strange results from WP_Query
- WP Query for Multiple Post Types
- Orderby query does not work for custom fields even with meta query
- Query by Category and Custom Field – Shortcode
- Querying posts with meta key and meta value not returning anything
- Use not custom fields in get_posts() meta_query?
- Loop through multiple custom fields with increasing number
- Return a single custom post from multiple meta queries
- new WP_query using custom fields
- Including ‘cat’ => $cat breaks meta_query
- Query string form $_GET[‘value’] is not working as meta value in wp_query
- 294 Queries on Mainpage of WordPress
- How to get all post_id and meta_value using meta_key in wp_postmeta table
- WP Query – Show custom posts only if user contain some user meta
- How do I subquery with custom meta fields?
- How to include custom fields in wordpress search
- Extend search query to search meta keys values based on search string