register_block_pattern()

最后更新于:2021-11-27 21:25:41

register_block_pattern( string$pattern_name, array$pattern_properties)

Registers a new pattern.

参数

$pattern_name

(string) (Required) Pattern name including namespace.

$pattern_properties

(array) (Required) Array containing the properties of the pattern.

响应

(bool) True if the pattern was registered with success and false otherwise.

源文件

文件: gc-includes/class-gc-block-patterns-registry.php

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