Search post by post meta with rest api.

Use filter rest_{$this->post_type}_query to add the post meta support in WP Rest API.

Use below code snippet to add the post meta support for post type Post.

Syntax:

http://mysite.com/wp-json/wp/v2/post?meta_key=<meta-key>&meta_value=<meta-value&gt;

How to use?

E.g. Get posts which post meta already-visited value is true.

http://mysite.com/wp-json/wp/v2/post?meta_key=already-visited&meta_value=true

Code Snippet:

Advertisements

WordPress 4.7 Introduces Twenty Seventeen Default Theme and WP REST API Content Endpoints — WordPress Tavern

https://videopress.com/embed/AHz0Ca46?hd=0

photo credit: Wikimedia CommonsWordPress 4.7 “Vaughan” was released today, named in honor of American jazz vocalist Sarah “Sassy” Vaughan. This release makes significant improvements to the new theme setup experience, inspiring the tagline: “Your site, your way.” Twenty Seventeen is making its debut in 4.7 as the first default theme designed for business websites. It…

via WordPress 4.7 Introduces Twenty Seventeen Default Theme and WP REST API Content Endpoints — WordPress Tavern