Select posts using @wordpress/data with query based on custom field always returns all records
It appears that REST API doesn’t support all the meta_query parameters that WP_Query does. Only the basic meta queries with some comparison operators are supported. Therefore we need to make one of workarounds to get what we want: Add some REST API Filter to our theme/plugin add_filter(‘rest_{post_type}_query’, function($args, $request) { $params = $request->get_params(); if(isset($params[‘meta_compare’])) { … Read more