Skip to content

CalderaWP/seo-rest-api-fields

Repository files navigation

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

About

BETA Adds SEO fields to the WordPres REST API response, and allows editing via the API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published