Hot answers tagged

1

This solution works with get_items() in /lib/endpoints/class-wp-rest-posts-controller.php of the v2 WP Rest API. First, you'll want to construct the GET arguments like you would for a new WP_Query(). The easiest way to do this is with http_build_query(). $args = array ( 'filter' => array ( 'meta_query' => array ( 'relation' ...


1

Here is a test i made on Localhost: For security reasons meta query is not allowed on WP Api, first what you have to do is to add meta_query to allowed rest_query by adding this function on your wordpress theme functions.php function api_allow_meta_query( $valid_vars ) { $valid_vars = array_merge( $valid_vars, array( 'meta_query') ); return ...



Only top voted, non community-wiki answers of a minimum length are eligible