Home › Forums › General Issues › Meta query for post object? › Reply To: Meta query for post object?
Ok, so I’ve narrowed it down to being a problem with my querying subfields inside a group field because I’ve tried the following:
• created a test_people post_object field outside of the authors group
• Keeping the return format as post object
• Wrap the value in an array
I’m able to get results with this code:
$author = 85;
$images_query = new WP_Query( array(
'post_type' => 'images',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => 'test_people',
'value' => array( '"'.$author.'"' ),
'compare' => 'LIKE',
),
),
));
*wrapping the value in an array causes another problem but I want to solve the first:
( Warning: trim() expects parameter 1 to be string )
The point it is, I’m not finding a way to query subfields with the function and this syntax:
'key' => 'authors_%_people'
Am I wrong in thinking groups can be treated like repeaters?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.