Support

Account

Home Forums Add-ons Repeater Field Query repeater field with two values Reply To: Query repeater field with two values

  • Please could you help me figure out how to run a WP_Query with meta_query such that posts-types are filtered by a subfield within a group field.

    I have a custom post type of image and an acf group field of authors with a subfield of people. People is a multi-select post_object field. What would I need to do to get images only where people contains a certain id?

    I’m trying something like this based on John Huebner’s comment above.

    $images_query = new WP_Query([
        'posts_per_page' => -1,
        'post_type' => 'images',
        'meta_query' => [
            [
                'key' => 'authors_%_people',
                'value' => ['85'],
                'compare' => 'IN'
            ],
        ],
    ]);

    I’ve clearly got something wrong, Nothing is working. Please help.