zacharywenner / rest-filter

Restores the `filter` param to post enpdpoints.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WP REST API - Filter parameter for posts endpoints

In WordPress 4.7 the filter argument for any post endpoint was removed, The filter argument allows the posts to be filtered using WP_Query public query vars. This plugin restores the filter parameter for sites that were previously using it.

Usage

Use the filter parameter on any post endpoint such as /wp/v2/posts or /wp/v2/pages as an array of WP_Query argument like so:

fetch( 'https://domain.com/wp-json/acf/v3/customposttype?filter[meta_key]=acfkey&filter[meta_value]=acfvalue');

About

Restores the `filter` param to post enpdpoints.

License:GNU General Public License v2.0


Languages

Language:PHP 100.0%