BETA Adds SEO fields to the WordPres REST API response, and allows editing via the API.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin initial commit Jul 20, 2015
tests initial commit Jul 20, 2015
.travis.yml initial commit Jul 20, 2015
Gruntfile.js initial commit Jul 20, 2015
README.md Mention rest_api_init in readme Jul 26, 2015
package.json initial commit Jul 20, 2015
phpunit.xml initial commit Jul 20, 2015
readme.txt initial commit Jul 20, 2015
seo-rest-api-fields.php use rest_api_init instead of init to load main class Jul 26, 2015

README.md

REST API SEO Fields

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.

Other SEO Plugins?

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.

License & Copyright