Try this:
$meta_query_args = array(
'meta_query'=>array(
array(
'key' => '_cornerstone_data',
'value' => $attachment_url,
'compare' => 'LIKE',
),
)
);
$meta_query = new WP_Query( $meta_query_args );
$posts = $meta_query->posts;
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
- 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
- Compare meta key separation
- query post based on comparison
- Get posts by meta value except one post [closed]
- Meta_query compare operator explanation
- meta_query ‘compare’ => ‘IN’ not working
- Sorting: custom query with orderby meta_value_num THEN by title
- WP_Query with checkbox meta_query
- Meta Query with date and time on the same Day before given time
- How to grab metabox value in wp_query meta_query key
- How can I create a WP_Query that returns posts where one meta_value
- How to count data records in wordpress which have same meta_value in wp_postmeta table?
- WP_Query display next custom post from today’s date
- Ordering Posts Type A by Custom Fields of related Post Type B
- Search Posts with Custom Fields as query
- Add condition of user capability in WP_query
- Any number in meta key (wp query)
- Is it a good idea to improve meta query performance by adding tax query?
- WordPress Comments sort by custom meta key
- Understanding the orderby in WP_Query?
- How to list custom fields as headers and list all pages sharing that custom field under it?
- Modify wp-query and sort by post meta key
- Orderby listing issue
- Make meta query treat meta_value as 1 or 0
- Query post by date (stored custom field meta as yyyymmdd) and differentiate across 12 months
- WP Query Meta Value – How To Identify Specific, Unique Values?
- Order by meta_key doesn’t work
- Intiger meta value with ‘>=’ returns posts with lower value
- Get meta_value of a specific meta_key from all posts belonging to a specific custom type
- Custom query filter by ACF date custom field
- Excluding posts with certain value of meta_key keeping posts without that meta_key
- Nested array issue in meta_query
- Error in meta_query not get result
- Sorting posts by Multiple custom fields in defined order
- How to get current page nearest parent id?
- meta_query with array as value with multiple arrays
- Why doesn’t my WP Meta Query return any results?
- meta_query – check for multiple meta values in key which holds an array of values
- Searching for a specific month in a metadata saved as Timestamp (Wp_Query)
- meta query multiple values for the same key
- WP_Query on custom key and value
- Get posts having meta value between two numbers
- How to set meta_query if get_post_meta returns nested array for that key? [duplicate]
- Custom post types – meta_query: search lesson which starts sooner
- ACF Post Object meta-query by title not ID
- Sorting with meta_query and multiple, optional meta keys
- From admin edit user page query either the user_nicename or username field value of the user profile being edited or viewed
- WP_Query returns empty if meta_query has more than 7 values
- WP_Query with Pagination and orderby meta_value_num showing duplicates
- WordPress meta_query not working
- Using orderby with 2 meta keys
- query_posts with sorting on a custom datestamp
- Passing conditional arrays to WP_Query() [closed]
- Custom Post Type + Custom Meta Query Not Showing 2012 Posts
- Display all custom meta field values from the database using ACF Repeater
- Taxonomy related query not working
- Get all user with both meta_value
- 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