Adds SEO Fields from WordPress SEO by Yoast to responses for posts in the WordPress REST API 2.0-beta3. Also allows for updating by an authenticated user.
This plugin is a free plugin by CalderaWP. It is not an official add-on for WordPress SEO and is no way associated with the makers of WordPress SEO.
- Requires WordPress REST API (WP-API) 2.0-beta3 or later.
- Requires WordPress SEO by Yoast
Right now this only works with WordPress SEO by Yoast. It could work with other plugins. Just create a new instance of the main class, and pass the title and description meta fields it uses.
if ( defined( 'REST_API_VERSION' ) && version_compare( REST_API_VERSION,'2.0-beta3', '>=' ) ) {
//update these variables!!!
$title_field = 'your_title_field';
$description_field = 'your_description_field';
new CWP_REST_API_SEO_Fields( $title_field, $description_field );
}
}
The above should be performed at the rest_api_init action.
-
Copyright 2015 Josh Pollock for CalderaWP LLC.
-
Licensed under the terms of the GNU General Public License version 2 or later.
-
Please share with your neighbor.