From the course: First Look: WordPress Full-Site Editing

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Block attributes and block supports

Block attributes and block supports - WordPress Tutorial

From the course: First Look: WordPress Full-Site Editing

Start my 1-month free trial

Block attributes and block supports

- [Instructor] Now that you've got the basics of how a block works, let's dig a little bit into block configuration, or declaration. So here, we're back at that JSON file where the paragraph block is defined. A block declaration is made up of a few things. For instance, here's the API version. Version two is the latest. There's the name of the block, which is structured as namespace dash block name, the category of the block, and then we've got these attributes and supports objects with various key value pairs. Let's start with block attributes. The block attributes object is the way a block stores data and defines how a block is parsed to get data back out from saved content. Think of this as sort of the glue that connects the edit and save functions in the block editor. So, going back to our paragraph block, here's a content attribute and this says the data type is a string, its source, or what's extracted from…

Contents