Skip to content

elyobo/wp-rest-jmespath

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WP REST JMESPath

Adds support for JMESPath queries to all WP REST API endpoints.

Installation

Install as per usual into wp-content/plugins or wp-content/mu-plugins.

Usage

The plugin checks REST API requests for the _query parameter; if present it treates this as a JMESPath expression and applies it to the response, e.g.

curl -s --globoff  "http://my.wordpress.site/wp-json/wp/v2/pages?_query=[0:2].{id: id, title: title.rendered}"

could be used to select only the first two posts (with the [0:2] slice) and from there build an object with id and title fields selected from id and title.rendered.

The JMESPath site has an interactive tutorial and examples.

About

A WP plugin adding JMESPath processing to the WP REST API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages