Just a few weeks ago, the WordPress Theme Review Team agreed to allow new themes to require the use of the WordPress REST API plugin.
The WordPress REST API plugin has been rumored to be making its way into core for quite some time now. Matt Mullenweg chimed into the REST API slack channel early in July to bring up some existing pre-merge issues:
“…pre-merge blockers (contributor confidence, TRT blocking rest-api, adoption, publicity/knowledge, core dev attention, vip review, et al)..”
Mullenweg highlighted adoption as a key barrier to the integration of the WP REST API into core. If more people understood the value of the WordPress REST API, the merge into core would have likely been welcome at an earlier stage.
By allowing developers to require the plugin for new themes, the Theme Review Team is hoping to accelerate mass adoption of the WP REST API into websites and new projects around the web.
While mass adoption is key, I’m not so sure this is the best way to achieve it.
Client Side Applications is one of the most anticipated uses of the WordPress RESt API—which will give developers an easy way to create AngularJS, React, and Backbone applications using the WordPress backend UI.
How will developers who are unfamiliar with the WordPress REST API come to understand this use of the API, when their first encounter with it is in a theme built for a blog?
A Great Move For The Advancement Of WordPress?
Plugins currently powered by the API are already allowed in the repo. This has greatly demonstrated the potential of the WordPress REST API in plugin development. This is not the case, however, when it comes to theme development.
With a plan for mass adoption underway, this should put the API in front of more faces. This will inspire developers to create new themes with unique functionality. In theory, these themes will get used by users and consultants, and in turn bolster the reputation and accelerate adoption as users and consultants alike see what the WordPress REST API is capable of powering.
The API Can Be Used For So Much More
WordPress can be used to create a solution for almost anything web related, it can be used to build and solve almost any business requirement. It is amazing how much it has evolved over the years—try installing WordPress version 1, it will take less than five minutes and you won’t be able to do much more than write content. Today it can be used to build anything from a portfolio website to an enterprise-level application.
The WordPress REST API is the next step in WordPress’s evolution—it decouples WordPress the CMS from other web technologies. If you can create something that consumes JSON data, no matter the technology, WordPress can now be the CMS to power it.
This not only opens up the WordPress ecosystem to a new world of opportunities, but it also affords those outside of WordPress an opportunity to offer an easy-to-use solution to their clients, while building out something that they never thought they could achieve with WordPress alone.
With that in mind, what can a theme do? It can get and manipulate data from the WordPress REST API, just to inject it into a normal WordPress theme. This is probably the least inspiring way to use such a great tool.
As Morten Rand-Hendriksen said, “the API is about being able to grab the same data you would normally, put it into a box, and then use ANYTHING to grab the data from the box.” I’ve always liked car analogies when I’m feeling exceptionally passionate about something, so my worry is that theme developers now have access to a Ferrari, but only use it to get groceries.
As more themes come out that utilize the API, more people will see how it can be used. Some of the more common uses we’ll see include loading comments and posts using the WordPress REST API.
It would be easy for someone with little or no experience with the WordPress REST API to believe that is its only use. The same individuals who have trouble understanding why to use the API and what JSON is, are going to be sold on functionality they see being released in themes. This is a problem.
Although the WP API needs mass adoption, it’s equally, if not more, important for its users to understand how it can be used to create cool things beyond themes.
For this reason, it’s important to inform WordPress users that the JSON REST API can be used for things outside of the theme development.
Conclusion
Allowing themes to require the WordPress REST API is a bold move by the core WordPress Theme Review Team. People like to see and repeat, it’s called code regurgitation. Including the WordPress REST API in theme development could highly undersell its capabilities and create an under appreciation for what the WordPress REST API can really be used for.
One of the biggest concerns of bringing the WordPress REST API into core is that it has not met expectations of adoption. Allowing themes to require its use will definitely help with that. Overall, it is a good move. Anything that helps push the integration of the API into core is the right move for the advancement of WordPress.
4 Comments