Hi,
Did you mean querying posts by custom fields?
If so, please try this code:
add_filter( 'rest_{type}_query', function( $args ) {
$args['meta_query'] = array(
array(
'key' => 'my_field',
'value' => esc_sql( $_GET['field'] ),
)
);
return $args;
} );
REST URL:
http://site.com/wp-json/wp/v2/posts?field=test
The wildcard {type}
can be: post | user | comment | attachment | custom post type | taxonomy.