Plugin / WP REST Filter
SK8TechDescription
Description
Since WordPress 4.7 the filter argument for any post endpoint was removed.
This plugin restores the filter parameter for websites that were previously using it.
Usage
Use the filter parameter on any Post, or Custom Post Type endpoint such as /wp/v2/posts or /wp/v2/cpt as an array of WP_Query
argument. ACF values are also supported.
Default Post Type
fetch( 'https://domain.com/wp-json/wp/v2/posts?filter[meta_key]=acfkey&filter[meta_value]=acfvalue');
Filter Users
fetch( 'https://domain.com/wp-json/wp/v2/users?filter[meta_key]=acfkey&filter[meta_value]=acfvalue');
Custom Post Type
fetch( 'https://domain.com/wp-json/wp/v2/cars?filter[meta_key]=currency&filter[meta_value]=AUD'); // here 'cars' is the endpoint for CPT
Advanced Custom Field
fetch( 'https://domain.com/wp-json/wp/v2/cars?filter[meta_key]=price&filter[meta_compare]=<&filter[meta_value]=200000'); // Query for car 'less' than '200000' in 'price'
Advanced Custom Field – By Date (before, equal & after)
fetch( 'https://domain.com/wp-json/wp/v2/cars?filter[meta_key]=expiry_date&filter[meta_value]=2018-12-27T23:59:59&filter[meta_compare]=< // 'Expiry' Before '2018 Boxing Day ends'
Advanced Custom Field – Value in Array (Single Value)
fetch( 'https://domain.com/wp-json/wp/v2/cars?filter[meta_key]=features&filter[meta_compare]=LIKE&filter[meta_value]=electric
Advanced Custom Field – Search
fetch( 'https://domain.com/wp-json/wp/v2/cars?filter[meta_key]=brands&filter[meta_compare]=LIKE&filter[meta_value]=tesla
Multiple Meta Queries
fetch( 'https://domain.com/wp-json/wp/v2/cars?filter[meta_query][0][key]=currency&filter[meta_query][0][value]&filter[meta_query][1][key]=country&filter[meta_query][1][value]=Australia'); // here 'cars' is the endpoint for CPT
Technical Support
SK8Tech – Customer Success Specialist offers Technical Support to configure or install WP REST Filter.
Our Services
- SK8Tech Sydney Web Design
- SK8Tech Enterprise Email Hosting
- SK8Tech Emergency IT Support
- SK8Tech WeChat Advertising
Contact Us
Based in Sydney, SK8Tech is a innovative company providing IT services to SMEs, including Web Design, App Development and more.
Ratings
Rating breakdown
Details Information
Version
First Released
Total Downloads
Wordpress Version
Tested up to:
Require PHP Version:
Tags
Contributors
Languages
The plugin hasn't been transalated in any language other than English.
DIRECTORY DISCLAIMER
The information provided in this THEME/PLUGIN DIRECTORY is made available for information purposes only, and intended to serve as a resource to enable visitors to select a relevant theme or plugin. wpSocket gives no warranty of any kind, express or implied with regard to the information, including without limitation any warranty that the particular theme or plugin that you select is qualified on your situation.
The information in the individual theme or plugin displayed in the Directory is provided by the owners and contributors themselves. wpSocket gives no warranty as to the accuracy of the information and will not be liable to you for any loss or damage suffered by you as a consequence of your reliance on the information.
Links to respective sites are offered to assist in accessing additional information. The links may be outdated or broken. Connect to outside sites at your own risk. The Theme/Plugin Directory does not endorse the content or accuracy of any listing or external website.
While information is made available, no guarantee is given that the details provided are correct, complete or up-to-date.
wpSocket is not related to the theme or plugin, and also not responsible and expressly disclaims all liability for, damages of any kind, arising out of the use, reference to, or reliance on, any information or business listed throughout our site.