With the advent of WordPress 4.4 last year in December, we saw the inclusion of the first half of REST API in the WordPress Core, and the rest of it is expected to be with us in the upcoming major release of WordPress.
Background photo by
Zach Betten on
Unsplash
That said, REST API has been around us in the WordPress world for quite a while, especially by means of the
REST API plugin. The community is abuzz with all talks about how important REST API will soon be for
WordPress development, and how it is going to change the way developers code and interact with WP.
So, how is REST API going to affect the WordPress users and developers, and what exactly will we be able to accomplish using it? We will find the answer to this question in this article.
How Will REST API Affect WordPress Developers?
The Rise of JavaScript
Matt Mullenweg made it pretty clear during his State of the Word 2015 address when he declared: “Learn JavaScript, deeply!”
With REST API in WordPress, the role of JavaScript in WordPress development will be increased manifolds as HTTP requests and other JSON queries will make good use of JS.
With Node.js rising in usage, coupled with the likes of AngularJS, React and Backbone.js, JavaScript surely is a popular entity on the web and as such, its rising importance in the world of WordPress development is a welcome note.
What About PHP?
WordPress is coded in PHP, so it is pretty obvious that the role of PHP cannot be diminished. However, with the rising influence of JavaScript, how will PHP keep up?
Well, PHP powers 80% of the web, so in all likelihood, there is hardly much that can be affected. But all said and done, REST API will actually influence PHP in an ostensible manner: now, for your third-party app to interact with WordPress, the app does not need to be in PHP anymore, as REST API can allow for cross-platform interaction between applications, which brings us to our next point.
Cross-Platform Interaction
REST API is more of an architectural style rather than a systems protocol. As such, it can be implemented on any platform that has been built or coded via any script or language. Thus, REST API can be used by an application that is built using Ruby on Rails, or by a plugin coded in PHP, or by software written in C#.
What this means is that even those applications and platforms can interact with and share data with WordPress that are otherwise not built using WordPress, or even PHP for that matter. So we can have websites and applications that are running in Python sharing data with WordPress sites, and vice versa.
The Backend? Who Needs it Now?
If you have been following the happenings in the WordPress community of late, you might have already heard of Calypso, or the desktop apps for WordPress.com that you can install on your computer and use to manage your blogs and websites (on WordPress.com or self-hosted WordPress sites running Jetpack) right from your desktop, without having to log into the WordPress admin panel.
Thus, such features add a whole new dimension to remote management of your website: you can actively monitor and manage your websites without having to log in at all -- create new posts and pages, moderate comments, edit and modify data, and so on.
Furthermore, you can even build apps that work atop WordPress without actually having to force the users to log in to WordPress.
Mobile Support
Much like desktop apps, REST API also adds a new dimension to mobile development vis a vis WordPress. Shortly, as REST API becomes better integrated and included within WordPress, you can expect a whole new array and fleet of mobile applications and better support for mobile devices.
Of course, WordPress.com does have its mobile app that also lets you administer Jetpack-powered self-hosted websites. And with REST API, you can expect more such applications that help you remotely manage and access your sites.
Conclusion
As you can see, REST API is here not just to change the way our plugins and themes interact with WordPress, but also to overhaul and modify the manner in which web development works currently in the world of WordPress.
There is no dearth of great literature if you wish to learn how to master REST API with WordPress. For instance, here is a wonderful overview of what REST API exactly is:
https://www.youtube.com/watch?v=llpr5924N7E
Similarly, as an existing WordPress developer, it might be well worth the effort to start learning JavaScript and REST API, so that by the time REST API is fully integrated into WordPress, you are ready to accept new challenges and come up with new solutions. For that matter, Tuts+ have an ongoing series about
WordPress REST API.
Are you an active WordPress developer? How excited are you about REST API and what impact do you think it will have in the world of WordPress development? Share your views and thoughts in the comments below!
(dpe)