-
Extending a WordPress block

What I learnt when attempting to extend a WordPress block.
-
Debug logging for production
If you’re developing a component and including checks for scenarios where the component is passed an unexpected prop, you’ll likely want to make sure that use case isn’t used in production. Depending on the type of component and what you are aiming to do, throwing an error could be an ideal option, given that the…
-
Deprecating a block – dealing with a larger codebase

If you’ve created a block plugin that’s in use anywhere other than on sites that you manage, then making sure you manage block deprecation when editing the save function or block attributes for a static block is something you may be familiar with. The developer.wordpress.org resources for understanding block deprecations are very useful – the…
-
Passing a JSON string as a flag value in WP CLI
You may find at some point that it could be very helpful to pass some data in the form of an array or object as an associated argument into a custom WP CLI command. At least, that is the situation I found myself in recently. To give an example, here’s a demonstration of a CLI…
-
Escaping strings in WordPress
What is escaping, and why escape? Put simply, escaping is making sure that data that is output to end users is rendered securely. Escaped data has had defensive measures applied to it, to prevent injection attacks (see the OWASP for a more in-depth reference here). The reason we have to escape is that we can…