WordPress开发者和主题制作者的搜索引擎



register_block_type ›

Since5.0.0
已弃用n/a
register_block_type ( $name, $args = array() )
参数: (2)
  • (string|WP_Block_Type) $name Block type name including namespace, or alternatively a complete WP_Block_Type instance. In case a WP_Block_Type is provided, the $args parameter will be ignored.
    Required: Yes
  • (array) $args { Optional. Array of block type arguments. Any arguments may be defined, however the ones described below are supported by default. Default empty array.
    Required: No
    默认: array()
返回:
  • (WP_Block_Type|false) The registered block type on success, or false on failure.
定义在:
文档:

Registers a block type.



源码

function register_block_type( $name, $args = array() ) {
	return WP_Block_Type_Registry::get_instance()->register( $name, $args );
}