Support

Account

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?