-
-
Notifications
You must be signed in to change notification settings - Fork 0
Backend - Site Editor - Patterns - Register Custom Pattern Category: Tour Operator #404
Copy link
Copy link
Closed
Copy link
Labels
comp:block-editorBlock/site editor workBlock/site editor workcomp:block-jsonBlock metadata (block.json)Block metadata (block.json)
Milestone
Description
Description
This task involves creating a custom block pattern category for the Tour Operator Plugin using the register_block_pattern_category() function. The custom pattern category will help organize patterns for better usability within the block editor.
References
Tasks
- Create a custom pattern category named
Tour Operator. - Register the category using the
register_block_pattern_category()function. - Ensure all relevant patterns are grouped under the new category.
Code Snippets
Here’s a code snippet for registering a custom pattern category for the Tour Operator Plugin using the register_block_pattern_category() function:
// Register a custom pattern category for the Tour Operator Plugin
function register_tour_operator_pattern_category() {
if ( function_exists( 'register_block_pattern_category' ) ) {
register_block_pattern_category(
'tour-operator',
array( 'label' => __( 'Tour Operator', 'tour-operator-plugin' ) )
);
}
}
add_action( 'init', 'register_tour_operator_pattern_category' );
This code registers a new pattern category called “Tour Operator,” making it available for organizing block patterns.
Acceptance Criteria
- The custom pattern category
Tour Operatoris successfully registered. - All related block patterns appear under this category in the block editor.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
comp:block-editorBlock/site editor workBlock/site editor workcomp:block-jsonBlock metadata (block.json)Block metadata (block.json)
Type
Projects
Status
✅ Done