A deep code dive into how to extend it.
Slides as presented at WordCamp Toronto, 2016 on how to use the WP JSON API to add your own end-point for a custom post type or add/change data being returned.
Paul BearneFreelance Senior WordPress Full Stack Developer at Paul & Gina Bearne
9. What will we cover today?
A bit on why it matters
How to install/setup
Where are the docs
What you get out of the box
How to mess with it
10. By the end, you should be able to:
Expose a custom post type in the API
View the output of the API
Send data to the API
Save data sent to the API
Return custom data to an API call
11. Why does it matter?
JSON data for free
Enables advance apps
Standardizes an AJAX endpoint
It makes WordPress an application framework
Performance – 15%+ faster
https://deliciousbrains.com/comparing-wordpress-rest-api-performance-admin-ajax-php
12. Install?
WP version 4.6 +
Install the plugin
Check permalinks are set
Test by loading /wp-json/wp/v2/posts
Install Postman and JSONview chrome tools
I am freelance so I need clients that will pay me to allow me to talk at WordCamp!
These are some of my clients that I help with their complex problems whose products you may find useful
LivePress is real time microblogging that is native on WordPress.
It is available as part of WordPress.com VIP platform.
I am freelance so I need clients that will pay me to allow me to talk at WordCamp!
These are some of my clients that I help with their complex problems whose products you may find useful
LivePress is real time microblogging that is native on WordPress.
It is available as part of WordPress.com VIP platform.
Uncanny Owl are eLearning experts that can help you and your clients provide eLearning solutions
We know it's hard to find a reliable WordPress expert when you need one, which is why we've set on a mission to bring them all to one place: here.
Join us and benefit from:
a steady income with a guaranteed minimum hourly rate
working with great, loyal clients
being a part of our reputable expert community
In this talk, I will show you how to use the WP JSON API to add your own end-point for a custom post type or add/change data being returned.
I will walk you through real, production level example code that extends the API and show you how simple it can be and how few lines it takes once you get your head around it.