Put a Little Backbone in Your WordPress
summary
Backbone and Underscore are bundled with WordPress and are used here to build client-side UIs that fetch and save JSON via the JSON REST API v2. Demos show a single-post model fetched by a custom sync URL, a collection-driven post list with a router and history, and an editable view using contenteditable that saves with model.save (requires a nonce required for saves and login). Uses WP_localize_script bootstrapping, WP_Backbone_View for subviews, and debounce/throttle to limit requests; the demos work but note API field changes like content.rendered.
AI-written summary · about
chapters (10)
- 0:00Introduction and story
- 3:14Why use Backbone.js
- 8:54Backbone basics and structure
- 13:14Fetching and bootstrapping data
- 19:31Underscore utilities in WordPress
- 24:45Coding in Backbone and challenges
- 30:03Demo 1: Displaying a single post
- 36:36Demo 2: List and detail views
- 42:16Demo 3: Editing content
- 47:18Conclusion and resources
