Musings on web, technology, worklife and more.

  • Setting default WordPress Editor Block Templates via PHP from Block Grammar

    WordPress allows you to provide a default block template (defined as a list of block items) for a given post. As such Block templates can be used to specify a default initial state for an editor session. This has been written about many times elsewhere and is particularly handy if you want to provide a … Continued

  • Mocking @wordpress/api-fetch in Gutenberg unit tests

    Learn how to easily mock out and control `@wordpress/api-fetch` in your unit tests,

  • Testing the Gutenberg Widgets Editor for WordPress 5.8

    WordPress 5.8 promises to bring an overhauled, block-based Widgets screen to WP Admin. I decided to give it a spin by following the recent call for testing instructions. Here’s what I found.

  • Mocking WP_Http in WordPress PHP Unit tests

    If you write automated tests for your PHP code (and you should try!) you’ll often find yourself needing to mock/stub calls to pieces of code that are not under test. With WordPress, our unit tests tend to be more akin to integration/functional tests where we’re testing that several pieces of interrelated code work well when … Continued

  • Building a standalone block editor in WordPress using Gutenberg

    A few month’s ago I merged a PR to Gutenberg Core for a new documentation tutorial called Building a custom block editor. The tutorial was originally produced for my own learning, but I was encouraged to add it to the official documentation by members of the Gutenberg core team and the WordPress community. The tutorial … Continued

  • Some contributions to the Gutenberg Core Navigation Block

    Over the past few months, the team I work in at Automattic were allocated to spend some time improving the experimental Navigation block in Gutenberg Core. This is how I was able to help.