Support

Account

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

Unread

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(
            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)

The topic ‘Relationship query with repeaters that contains objects’ is closed to new replies.