Thanks to the organizers, volunteers, and everyone attending WordCamp NYC for a great event!
Below, you can find the slides and code for my talk on the Heartbeat API for WordPress.
.@GetSource, showing us how to make WordPress honk with the heartbeat API at #wcnyc pic.twitter.com/IwyRKZm4V2
— K. Adam White (@kadamwhite) August 3, 2014
In this presentation, I also included a sample for a custom WordPress API endpoint (hat/tip Ryan McCue) for causing the WordPress admin to honk via a GET request (which is decidedly unRESTful, but equal to the way the Tesla Model S API works). I then provided this URL to the audience prior to discussing the code for much hilarity.
So @GetSource made a custom endpoint with the Heartbeat API to honk a horn in his presentation at #wcnyc: http://t.co/llFoO3e3uR
— Brian Krogsgard (@Krogsgard) August 3, 2014
Luckily, @getsource used heartbeat #wcnyc pic.twitter.com/IkLAzj18cE
— Brent Shepherd (@thenbrent) August 3, 2014
https://twitter.com/alpha1beta/status/496018182571048960
The code’s after the break. But think twice about deploying it on a production server, since it allows others to annoy you with unauthenticated requests. The JSON REST API plugin is required prior to the JSON API’s introduction in WordPress Core itself.
You can download the slides in PDF, and see the slides inline from Speaker Deck below.