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



register_block_style ›

Since5.3.0
已弃用n/a
register_block_style ( $block_name, $style_properties )
参数: (2)
  • (string) $block_name Block type name including namespace.
    Required: Yes
  • (array) $style_properties Array containing the properties of the style name, label, style (name of the stylesheet to be enqueued), inline_style (string containing the CSS to be added).
    Required: Yes
返回:
  • (boolean) True if the block style was registered with success and false otherwise.
定义在:
文档:

Registers a new block style.



源码

function register_block_style( $block_name, $style_properties ) {
	return WP_Block_Styles_Registry::get_instance()->register( $block_name, $style_properties );
}