get_comment_delimited_block_content
函数
get_comment_delimited_block_content ( $block_name, $block_attributes, $block_content )
- 参数
-
-
(string|null)
$block_name
Block name. Null if the block name is unknown, e.g. Classic blocks have their name set to null.- Required: 是
-
(array)
$block_attributes
Block attributes.- Required: 是
-
(string)
$block_content
Block save content.- Required: 是
-
(string|null)
- 返回值
-
- (string) Comment-delimited block content.
- 定义位置
-
-
wp-includes/blocks.php
, line 713
-
wp-includes/blocks.php
- 引入
- 5.3.1
- 弃用
- –
Returns the content of a block, including comment delimiters.
function get_comment_delimited_block_content( $block_name, $block_attributes, $block_content ) { if ( is_null( $block_name ) ) { return $block_content; } $serialized_block_name = strip_core_block_namespace( $block_name ); $serialized_attributes = empty( $block_attributes ) ? '' : serialize_block_attributes( $block_attributes ) . ' '; if ( empty( $block_content ) ) { return sprintf( '', $serialized_block_name, $serialized_attributes ); } return sprintf( '%s', $serialized_block_name, $serialized_attributes, $block_content, $serialized_block_name ); }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。