jk's blog

WordPress Study

I’m studying the wp.media library, and Backbone.js. I never really did anything with except toy programs with Backbone – and I didn’t really grok it, so now I can learn it… post Angular and post-React. It’s going backwards in time, but, still instructive because the Backbone.js idioms are different from the easier-to-use frameworks. I’ve also seen how I have re-invented some wheels when I could have used Backbone.

Understanding wp.media’s a little difficult because the documentation is pretty scattered out there.

The wp.media libraries are a pretty solid, lean application framework built on top of Backbone.js. While we mostly experienced it as the Media Library modal dialog in WP, it’s used in a lot of places within WP, and it’s replacing parts of admin screens. The code is good enough.

This started because I’m writing a hack to turn the Customizer into a simple, non-designer-friendly site editor/builder. I thought it’d be easy because I know enough backend to do myself in, but the front end was becoming an exercise in reinventing the wheel, so here I am. Behind schedule, but learning a lot.

So, this “book” is links to all the wp.media and related posts. Consider them all drafts with bad information! You have been warned.

I’m posting notes, with disclaimers, as I read the code and docs here and there, and make notes. If I find old notes, I’ll post those too. I’m posting them because there isn’t that much documentation out there, so even crap information can help.