Home Forums Add-ons Repeater Field Relationship query with repeaters that contains objects


Relationship query with repeaters that contains objects

  • Hi Developers!

    I’m trying to do a relationship query that contains the next:

    I have two custom post types named Application and Platform, so, the Application has a repeater where this contains a post object (the relation with a Platform) and others random fields.

    So, In a page where the user filters some data, I need to filter Applications that have selected a specific Platform inside a repeater. And for this, I was trying this query but is not working for me:

    $platform_id = $_GET['platform_id'];
    $args = array(
        'post_type' => 'applications',
        'meta_query' => array(
                'key' => 'platform_informations_%_platform',
                'value' => '"' . $platform_id . '"',
                'compare' => '='
    $applications = new WP_Query( $args );
    // here go the loop

    So, the platform_informations is the repeater name, and the platform is the name of the field that contains the platform post object.

    Any ideas why this does not work?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.