register_block_pattern()WP 5.5.0

Registers a new block pattern.

No Hooks.

Return

true|false. True if the pattern was registered with success and false otherwise.

Usage

register_block_pattern( $pattern_name, $pattern_properties );
$pattern_name(string) (required)
Block pattern name including namespace.
$pattern_properties(array) (required)
List of properties for the block pattern. See WP_Block_Patterns_Registry::register() for accepted arguments.

Changelog

Since 5.5.0 Introduced.

Code of register_block_pattern() WP 6.0

function register_block_pattern( $pattern_name, $pattern_properties ) {
	return WP_Block_Patterns_Registry::get_instance()->register( $pattern_name, $pattern_properties );
}