Book Image

Learning WordPress REST API

By : Sufyan bin Uzayr, Mathew Rooney
Book Image

Learning WordPress REST API

By: Sufyan bin Uzayr, Mathew Rooney

Overview of this book

The WordPress REST API is a recent innovation that has the potential to unlock several new opportunities for WordPress developers. It can help you integrate with technologies outside of WordPress, as well as offer great flexibility when developing themes and plugins for WordPress. As such, the REST API can make developers’ lives easier. The book begins by covering the basics of the REST API and how it can be used along with WordPress. Learn how the REST API interacts with WordPress, allowing you to copy posts and modify post metadata. Move on to get an understanding of taxonomies and user roles are in WordPress and how to use them with the WordPress REST API. Next, find out how to edit and process forms with AJAX and how to create custom routes and functions. You will create a fully-functional single page web app using a WordPress site and the REST API. Lastly, you will see how to deal with the REST API in future versions and will use it to interact it with third-party services. By the end of the book, you will be able to work with the WordPress REST API to build web applications.
Table of Contents (16 chapters)
Learning WordPress REST API
Credits
About the Authors
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface

Ever-growing REST API


While work on REST API has started, the development of the project has since taken an extended period because of the aim the project has nowadays—growing exponentially. In the beginning, the REST API was just a method of underlying data in WordPress, and some of the code found in the first version still exists nowadays. The limit is set at four core objects such as the users, posts, taxonomies and metadata that were decided early on. Even if this seems somewhat set on limitations, it will set the REST API to cover options and any other kind of data types. The REST API, being identical to the core of WordPress, was built with extensibility in mind and thus includes the infrastructure for handling the remaining data types in doing anything that you'd like as a developer.

The infrastructure of the API will support nearly everything, and if the core endpoints are taken away, it will be considered as a framework for building APIs that can be built any way you'd like. It,...