New series: what assistive tech really hears on your checkout page. Start with part one →
Shipwright
Home
WordPress Jul 1, 2026 1 min read 177 views Updated Aug 10, 2026

Building a Classic Theme Customizer Panel Live

Tomás Herrera

Tomás Herrera

@tomasherrera_

Share
Cover illustration for the article Building a Classic Theme Customizer Panel Live

A screencast adding a section, a setting, and a control with live preview. WordPress rewards developers who work with its APIs instead of around them. Almost every problem we have debugged in client projects started with a shortcut that bypassed a core function.

Sample footage: a CC0 clip from the MDN Web Docs example media.

The WordPress way

Register things on the right hook, pass complete arguments, and let core handle the rest. It is more typing up front, but the result survives updates and plays nicely with other plugins.

  • Check capabilities before doing anything.
  • Verify a nonce on every state-changing request.
  • Sanitise input and escape output, always.
  • Script test sites with WP-CLI.

Every endpoint and form needs three things: a capability check, a nonce or equivalent, and sanitisation on the way in with escaping on the way out. Skipping any one of them is how sites get compromised.

None of this is new, and that is the point. The techniques that last are usually the boring ones that are documented well and supported by the platform itself.

As always, the examples are simplified to fit on a page. The production version has more error handling and logging, but the shape of the code is the same.

Any fool can write code that a computer can understand. Good programmers write code that humans can understand.

Martin Fowler, Refactoring, 1999

Tomás Herrera

Tomás Herrera

Author

PHP and WordPress developer for fifteen years. Tomás maintains a handful of open-source plugins and a strong opinion about hooks.

Related Posts

Comments 3

Hannah Becker

Clear, practical, no fluff. More of this, please.

Diego Alvarez

Counterpoint: for small teams the simpler approach in the first section is usually enough.

Fatima Zahra

The quote in the middle is doing a lot of work here, and it earns it.

Leave a comment

Your email will not be published. Sign in for a faster experience.

Supports **bold**, *italic*, and `code`.