首页 WordPress函数大全 register_block_type()

register_block_type()

2020-05-02 / 5026阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

register_block_type( string|WP_Block_Type $name, array $args = array() )

注册块类型。

描述

参数

$name

(string|WP_Block_Type)
(Required)
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.

$args

(array)
(Optional)
Array of block type arguments. Any arguments may be defined, however the>

  • 'render_callback'
    (callable) Callback used to render blocks of this block type.

Default value: array()

返回

(WP_Block_Type|false) The registered block type on success, or false on failure.

大家谈论
    我的见解