Conditionally Load Block Assets, Part 2

Another look at conditionally loading block assets for WordPress blocks, assets being JavaScript and CSS files loaded by the browser. In the previous post, I solved using heavy-handed testing of each post in the loop checking to see if it contains our block to load the assets. The company I work for runs a few […]

Conditionally Load Block Assets

Updated: see Part 2 post that explains a better way, as pointed out in the comments. One of the great features of the WordPress Block Editor is all the specialty blocks that can be created. This can also be the downside, each of these niche blocks might load their own view assets; and if not […]

Build a Block Series – Part 7: Placeholder

In this seventh part, I do away with screencasting and work on improving the editor interaction with the QRCode block. Specifically, showing in the editor how the QRCode will look when published. Previous screencasts: Development Environment WordPress Plugin Anatomy of a Block Block Attributes ES6+ Syntax QRCode Intro One of the primary tenets of Gutenberg […]

Build a Block Series – Part 6: QRCode

In this sixth screencast I get down to implementing the QRCode part of the block: loading the qrcode.js library and trigger it using the saved URL to create a QRCode. Previous screencasts: Development Environment WordPress Plugin Anatomy of a Block Block Attributes ES6+ Syntax QRCode Implementation In the cast, I alter the block’s save function […]

Build a Block Series – Part 5: ES6+ Syntax

The fifth part of my series walking through building a Gutenberg block for the WordPress editor. This part takes a break from new block development to explain some features of ES6+ syntax used, specifically Destructuring assignments, Arrow functions, and Imports. Previous screencasts: Part 1: Development Environment Part 2: WordPress Plugin Part 3: Anatomy of a […]

Build a Block Series – Part 4: Block Attributes

The third part in my series walking through building a Gutenberg block for the WordPress editor. This lesson covers the anatomy of a block. Previous casts: Development Environment WordPress Plugin Anatomy of a Block Block Attributes Attributes are the way a block stores data, they define how a block is parsed to extract data from […]

Build a Block Series – Part 3: Anatomy of a Block

The third part in my series walking through building a Gutenberg block for the WordPress editor. This lesson covers the anatomy of a block. Previous casts: Development Environment WordPress Plugin Anatomy of a Gutenberg Block At its simplest, a block in Gutenberg is a JavaScript object with a specific set of properties. Here is the […]

Build a Block Series – Part 2: WordPress Plugin

The second part of my series walking through building a Gutenberg block for the WordPress editor. See Part 1: Development Environment. Part two covers creating a WordPress plugin and setting up the JavaScript build for block development. After this part, all the pieces are in place to start creating a block. WordPress Plugin A WordPress […]

Build a Block Series – Part 1: Development Environment

I’m kicking off a new series of screencasts for building a Gutenberg Block for the WordPress Editor. The intended audience is a developer who may not have experience with WordPress and/or JavaScript, so introductory level. The series will focus on building a QRCode block, that I have an idea for but have not yet built. […]

Good first issue on Gutenberg

This post and screencast walks through the process for how you can make your first contribution to Gutenberg. I walk through all my steps to submit this Gutenberg PR#18175 This follows up on my previous screencast for creating a Storybook story for Gutenberg components. Steps 1. Find issue to work on. Search using the good […]

Coding a Storybook Story

Being inspired by my colleague Jon Q videos for building a Gutenberg Component. I wanted to try my own, just focused on building the story part for Storybook. Q’s videos are great, they go deep into the thinking and details for designing components and a large component design system. My screencast is just short and […]

Allowing SVG in WordPress Content

I ran into an issue when trying to save SVG as part of a block. If you are having the same issue, or similar with non-typical tags being used; then here’s how you can fix it. In creating a Gutenberg block, adding an SVG element as part of the save() function it was being stripped […]

Making the Juxtapose Block

This post walks through my process of creating the Juxtapose Block for the WordPress block editor. The block implements the JuxtaposeJS library by Knight Lab which allows you to place two images side-by-side and use a slider to reveal the difference between them. Here’s an example: Breaking down the problem When creating a block, I […]

Block Rocking WordPress

WordPress 5.0 introduces a new editor based around blocks. The editor is the first phase of a larger project developed under the Gutenberg name. This post is part three in my unplanned series: Part I – Creating a Gutenberg Block from October 2017 covers how to extend Gutenberg with a basic block. I wrote a […]

Gutenberg blocks without the build step

You can create Gutenberg blocks in ES6 code without the build step, this makes it easier to maintain and develop. I switched over my Code Syntax Highlighting block and am much happier for it. All of the Gutenberg examples by default use ES5 code, which already does not require transpiling with webpack, but they also include […]

Gutenberg can do that!

A new editor is coming to WordPress, the project code name is Gutenberg but at some point it will be just the WordPress editor, for now it is referred to as Gutenberg or the Gutenberg editor. The focus of this article is on some of the new features you can do with Gutenberg. If you […]

Code Syntax Highlighting in Gutenberg

I’ve developed a WordPress plugin which extends the core Gutenberg code block adding color syntax highlighting. If you are using Gutenberg to display code and want some color, install and check it out. It is available at github.com/mkaz/code-syntax-block. I initially started to build as a separate block, but that introduced the issue of converting existing […]

Creating a Gutenberg Block

A tutorial on how to build a Gutenberg block. The intended audience is a WordPress theme or plugin developers with some Javascript experience interested in learning what it takes to create a block in the new Gutenberg editor. Updated: See my new post postĀ Gutenberg blocks without the build stepĀ for a simpler example without the extra […]