This documentation describes unreleased changes on the main branch.

CustomBlockCategory

Interface.

use Saij\WpAppFramework\Block\CustomBlockCategory;

Implemented by a string backed enum whose cases are block categories of the theme or plugin: #[Block(category: Category::Sections)]. The build calls label() and icon() for every case and registers each case as category {namespace}-{value}, before the categories of WordPress.

Methods

icon()

icon(): ?string

Name of a dashicon shown next to the title in the inserter, e.g. "layout"; null for none.

Returns ?string

label()

label(): string

Title of the category in the inserter.

Returns string