Skip to content

Backend - Site Editor - Patterns - Register Custom Pattern Category: Tour Operator #404

@ashleyshaw

Description

@ashleyshaw

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 Operator is successfully registered.
  • All related block patterns appear under this category in the block editor.

Metadata

Metadata

Labels

Projects

Status

✅ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions