From the course: WordPress Development: Coding Practice
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Create your own block pattern - WordPress Tutorial
From the course: WordPress Development: Coding Practice
Create your own block pattern
- [Instructor] One of the great things about the block editor in WordPress is the ability to create reusable blocks and block patterns. So let's say we have a common set of blocks where the information could change that we like to use and reuse and we don't want to have to copy and paste them. A reusable block won't work here because when we change the reusable block in one place we change it every place. So we're going to need a block pattern. Now there are a couple of steps you need to do before we actually get to the coding phase. First, you'll want to build out the blocks in the block editor. Then you'll want to select and copy all of those blocks. Next, you'll need to run them through the json formatter over at jssoformatter.org/json-escape. This will properly escape our block pattern. Then you'll use that output for the text in the plugin. If you want to learn more about creating block patterns check out my course…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Dynamic copyright year2m 50s
-
(Locked)
Randomize posts5m 37s
-
(Locked)
Get post meta3m 19s
-
(Locked)
Change admin colors based on the server5m 18s
-
(Locked)
Create your own block pattern5m 58s
-
(Locked)
Append a message to RSS content5m 31s
-
(Locked)
Sanitize input4m 39s
-
(Locked)
Sanitize output4m 4s
-
Add a sitewide banner to the top of the page3m 32s
-
(Locked)
Register a custom post type5m 37s
-
(Locked)
Store user meta5m 29s
-
(Locked)
Send an email to the admin when a plugin is activated6m 42s
-
(Locked)
When a user logs in, greet them by their name4m 44s
-
(Locked)
Create a transient5m 30s
-
(Locked)
Hide content based on a query string5m 49s
-
-