Answer – the correct formulation is…
'meta_query' => array(
array(
'key' => 'Topic',
'value' => "12057",
'compare' => 'LIKE'
)
)
In full:
` $args = array(
‘taxonomy’ => ‘event’,
// ‘order’ => ‘ASC’,
‘hide_empty’ => false,
‘hierarchical’ => true,
// ‘parent’ => 0,
'meta_query' => array(
array(
'key' => 'Topic',
'value' => "12057",
'compare' => 'LIKE'
)
)
);
$events = get_terms( $args );`
Specifically, it seems 'compare' => 'LIKE'
needs to be present.
Initially, I had thought the solution was to use double quotes on the value, which I inferred from @hube2’s response to another question.
But actually it works with single or double. The clincher is the present of 'compare' => 'LIKE'
.
Related Posts:
- Filtering multiple custom fields with WP REST API 2
- How to get_terms() only of terms matching an ACF meta value?
- WP REST API: Order posts by meta value (acf)?
- Check for the existence of custom field
- pre_get_posts filter using numeric meta_query comparison (from dates)
- Using meta_query and custom fields within pre_get_posts to return posts within a numerical range
- Comparing arrays with meta_query in pre_get_posts
- ACF repeater field with meta_query
- sort by date in Advanced Custom Field
- Get specific repeater row (via advanced custom fields) based on Meta Query with Wildcards [closed]
- Using pre_get_posts for meta value of LIKE comparison on ACF repeater sub field
- Display post in order of ACF checkbox?
- Filter posts by advanced custom field
- Get posts with multiple meta values
- Order get_terms by multiple meta_values
- Query and display only by first letter of the get_field value
- Sorting get_terms, ACF is automatically removing duplicates
- How can you query posts by advance custom field when the value is a serialized array? [closed]
- Query by radio button ACF
- WP get_posts meta_query using ACF repeater field
- get_posts filter meta_query using ACF Checkbox
- Multiple orderby date arguments
- Display posts every specific day
- wp_split_shared_term_batch messing up upgraded ACF 5 data
- Array sorting by custom field date
- Displays a string of linked images
- Time sort with meta_key using UNIX timestamp failing due to date differences
- Order get_terms using a Custom Field
- ACF Relationship Field Search Filtering [closed]
- ACF datepicker meta_query Compare Dates in m/d/Y g:i a – Not in Ymd Format
- wordpress REST-API upload image to ACF
- Meta Query “IN” doesn’t work with ACF checkbox filter
- How to add a custom field to quick edit
- Gutenberg First Block on Page Conditional?
- How to order by just the Time Field in Advanced Custom Fields
- how to create a proper query for getting a list of users with taxonomy related meta key
- Using Gutenberg parse_blocks Function With ACF Custom Blocks?
- How to update custom taxonomy meta using ACF update_field() function or any other wordpress function
- Thumbnails generated from PDF in the “Media” section – how to show them in theme template?
- How to count ACF Flexible Content Rows?
- Query between dates using date picker filter breaks in WordPress 4.2.1
- Operations with custom fields values in a loop
- Get ACF value after update user using save_post
- How can I track and output when a field is updated? (currently using Advanced Custom Fields)
- How to write PHP array to render JSON-LD Markup for Job Postings, with ACF
- Custom query based on meta key – Reduce three states to two in results?
- Add up values from ACF number field
- Advanced Custom Fields: Conditional Statement with Select
- Any number in meta key (wp query)
- Add PDF to ACF image field from file url
- Meta Query Not Returning Output Despite Having Matching Values
- Bulk-Update Custom Posts
- How to get custom fields in a post when published
- Get all custom fields with wp’s get_posts()
- How to populate a parent page with its child subpages and associated templates
- Find the first occurrence of a custom field
- ACF Add fields values to newly inserted post [closed]
- Programatically re-order images in the ACF gallery add-on. Orderby Title, ID, etc
- ACF Relationship – Limit to specific pages
- Display total unique custon field results
- Advanced custom fields – pulling data in from another page
- ACF: If field contain a specific value, update value in another field programatically
- Displaying user data within ACF relational field (user type)
- Can’t get taxonomy ID for each post on archive page
- ACF Image field not displaying in WordPress with Visual Composer [closed]
- ACF checkbox array is returning numbers, not labels [closed]
- Building large multi-section pages with Advanced Custom Fields
- Showing a post depending on the Custom Field value
- How can I get the name of term post meta value which equals term id
- Advanced Custom Fields – category image
- Widget Code / Advanced Custom Fields / Elementor
- ACF: Update field value based on value of another field
- Prevent other hooks from firing after wp_update_post() outside of editor
- get_field values for each post on home page using wp_add_inline_style
- Where to place CSS if add a new layout to FLexible Content Template
- Trying to update repeater field (ACF) dynamically with data from Contact Forms 7
- Get title color from category custom field
- How to get a product’s Custom Fields in a different template file?
- Explore custom posts (CPT UI & ACF) database from WP UI
- pre_get_posts hook not targeting search results page query
- ACF – get custom taxonomy term image field
- Filter result of Custom Post Type using meta_query with ACF
- get the title of a relationship field
- ACF Dynamic select not showing data
- How to call ACF field in functions?
- Looking for a javascript callback action to re-initiate a custom slideshow in gutenberg
- Help using an array in ‘exclude’ key of another array
- Pre get posts sort by meta key returns no results if meta key does not exist
- Front page showing ACF only once, is that solvable to show the ACF per post? [closed]
- Add column and acf field content for cpt
- ACF scheduled repeater fields
- Advanced Custom Fields Show After Password [closed]
- Multiple loop issue – pull one featured and then continue the loop
- Check if meta_key exists in wp_list_pages
- ACF + WPML: How to translate date fields?
- Using ACF custom field for custom post type to order categories
- PHP calls to custom fields not being made. Query seems to be blocking them
- Custom headings on WYSIWYGs per flexible content module in ACF
- Same ACF Relationship field for multiple Post Options sub-pages?
- Pending posts showing category until published