Media query and Nestable slider (acf/ JetEngine gallery field)

Ok. Got it.

You can create your own query for this scenario. In my example below I added an ACF gallery field (called gallery) to the regular post post type.

add_filter( 'bricks/setup/control_options', function( $control_options ) {
    $control_options['queryTypes']['gallery'] = esc_html__( 'Galerie', 'as' );
    return $control_options;
} );

add_filter( 'bricks/query/run', function( $results, $query_obj ) {
    switch ( $query_obj->object_type ) {
        case 'gallery':
            $images = get_field( 'gallery' );
            if ( ! empty( $images ) ) {
                $results = $images;
            }
            break;
    }
    
    return $results;
}, 10, 2 );

add_filter( 'bricks/query/loop_object', function( $loop_object, $loop_key, $query_obj ) {
    switch ( $query_obj->object_type ) {
        case 'gallery':
            global $post;
            $post = get_post( $loop_object['ID'] );
            setup_postdata( $post );
            break;
    }
    
    return $post;
}, 10, 3 );

CleanShot 2023-02-13 at 09.41.36@2x

Result:

6 Likes