wc15-slides



wc15-slides

0 0


wc15-slides

WordCamp 2015 slides

On Github nathanshubert / wc15-slides

Building theme components with the WP REST API and Angular.js

Nathan Shubert-Harbison

@_nathansh            nathansh.com

Who's the beardo?!

The beardo == total nerd

- 1998 (web and music) - Musicians - Band sites (tables -> css -> flash) - Small businesses - Music school - Freelance, agnecies, Domain7

Workaround needed for PDF with image only slide

Workaround needed for PDF with image only slide

Workaround needed for PDF with image only slide

Workaround needed for PDF with image only slide

The WP REST API

Lot of ground, questions at end, happiness bar.

What is an API anyways?

  • Application Program Interface
  • Means to hook into an application
    • Data
    • CRUD
    • Functionality
- Most web APIs are around data - Functionality like iOS camera, Google geotagging

Endpoints

REST

- Approach to architecture - Simple, lightweight, powerful - Instagram, Twitter, etc - Often return json

Why do we want this in WordPress?

Data portability

  • Apps
  • Other apps
  • Aggregation and feeds
  • Mashups! Can be backend for own data apps

Access our own data differently

JS

What about XML-RPC and RSS?

  • XML-RPC is really difficult to use
  • Also, it's 2015
  • XML is harder to consume than JSON
  • RSS isn't customizable by the consumer
  • Where's the Twitter XML-RPC API, huh?Haig did amazing things with this

Everything you've always wanted CRUD

Main version, stable, in production.

Beta, subject to change

GitHub, most recent

It's the future

- Has gained tons of traction - Will be in core - Themes can use it today - Jobs

Angular.js

- MVW JavaScript framework

Why should I care about Angular.js?

  • Templating system is preeeetty great
  • Great and dealing with AJAX
  • Easier than jQuery for templating and AJAX
  • Component to single page app
  • Community adoption/support
  • Jobs 💰💰💰

WP REST API + Angular.js = ❤️

Workaround needed for PDF with image only slide

Demo project, slides and links

  • nathansh.com/wc15

Contact me

  • nathansh.com
  • @_nathansh
  • github.com/nathanshubert
Building theme components with the WP REST API and Angular.js Nathan Shubert-Harbison @_nathansh            nathansh.com