Beyond the Theme – WordPress as an API

“Beyond the Theme” is a talk aimed at professional WordPress theme and plugin developers which reviews different ways to enhance the user’s experience by adding some key features to WordPress. Features include a public API, a custom post type editor, AJAX callbacks, a URL shortener, social bookmarking and sharing, and advanced term filtering. At the heart of these features it is the concept of using WordPress as an API, hence allowing WordPress’ content to be published “Beyond the Theme.”

An API (Application Programming Interface) is a way for two applications to talk to each other in a common language that both systems understand. An API essentially provides a structured way for applications to get content in a predictable, flexible, and powerful way.

The biggest impact that an API can make is with mobile development. With the rapid adoption of smart phones and tablets on the market, there is a need to develop apps that work on all of these mobile platforms. Therefore, having an API that can deliver content seamlessly to those applications is essential.

Building a web-based API is about shifting from the website as both content and container to separating the content from its presentation. A website then becomes just an instance of the content within the context of a browser as the container, or in this case, a WordPress theme. So, as long as the content can be “queried” by a mobile device or web application, the presentation of the content can be determined within the context of that particular device’s container.

Over the years WordPress has evolved from a blogging platform to a full-featured CMS. The next natural step is to become an API, allowing for content distribution across mobile devices and third-party web applications. WordPress makes integrating API calls very easy by separating the back-end admin from the front-end theme. The admin interface exists for content entry and site maintenance while the theme focuses on the user interface and design. By using WordPress’ custom URL structure, a plugin can easily allow for API and AJAX calls to query WordPress for JSON data or HTML snippets similar to the way in which a theme does.

Throughout this talk several real world examples using the KickPress API will be reviewed so that by the end of the session there will be clear and tangible ways that theme and plugin developers can integrate these simple concepts into their next WordPress project.