Name: seo-rest-api-fields
Owner: Caldera Labs
Description: BETA Adds SEO fields to the WordPres REST API response, and allows editing via the API.
Created: 2015-07-20 22:48:20.0
Updated: 2017-09-15 11:14:31.0
Pushed: 2015-07-26 01:48:03.0
Size: 136
Language: PHP
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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.
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.