Skip to main content
1 of 2
fcb1900
  • 101
  • 3

I got it. I have to check, if in array is "['meta_query'][0]['value']" set or not :)

add_filter('rest_test_query', function($args) {
    
    $args['meta_query'] = array(
    array(
        'key'   => 'test_1',
        'value' => esc_sql( $_GET['test_1'] ),
        )
    );
    
    //echo $args['meta_query'][0]['value'];
    //print_r($args);
    
    if (!empty($args['meta_query'][0]['value'])) {
        return $args;       
    }
    
} );
fcb1900
  • 101
  • 3