Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Sameer Borate:
Accessing WordPress data using the new REST api
Jul 16, 2015 @ 14:53:57

Sameer Borate has posted an article showing you how to use the WordPress REST API (set up by this plugin) to access the data housed inside your WP installation.

WordPress is without doubt the most used CMS system around. Various sources peg the usage around 20-30% of all web sites. Whatever the correct figure, there is no doubt that the collective content of WordPress sites is enormously large. However almost all content is virtually held in independent WordPress sites with no way to easily access a sites content programmatically. [...] As WordPress is moving towards becoming a fully-fledged application framework, we need new APIs. At present a REST api plugin is available to access your site’s data in simple JSON format, including users, posts, taxonomies and more.

He walks you through the installation of the plugin and how to make a request to the REST API's test endpoint to ensure everything's functioning correctly. He also includes an example request that fetches the contents of a post by it's ID. The tutorial wraps up with a look at authentication and how the plugin provides two kinds of handling: basic authentication (HTTP Auth) and OAuth. You can find out more about the structure and functionality of the API on the project's website.

tagged: wordpress rest api tutorial installation setup plugin

Link: http://www.codediesel.com/wordpress/accessing-wordpress-data-using-the-new-rest-api/


Trending Topics: