WP-API/rest-filter

Name: rest-filter

Owner: WordPress REST API Team

Description: Restores the `filter` param to post enpdpoints.

Created: 2016-12-04 19:35:25.0

Updated: 2018-05-08 14:11:18.0

Pushed: 2018-05-02 00:50:09.0

Homepage:

Size: 9

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

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:

h( 'https://example.com/wp-json/wp/v2/posts?filter[name]=the-slug');

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.