render_block_core_widget_group

函数


render_block_core_widget_group ( $attributes, $content, $block )
参数
  • (array)
    $attributes
    The block attributes.
    Required:
  • (string)
    $content
    The block content.
    Required:
  • (WP_Block)
    $block
    The block.
    Required:
返回值
  • (string) Rendered block.
定义位置
  • wp-includes/blocks/widget-group.php
    , line 17
引入
弃用

Renders the ‘core/widget-group’ block.

function render_block_core_widget_group( $attributes, $content, $block ) {
	global $wp_registered_sidebars, $_sidebar_being_rendered;

	if ( isset( $wp_registered_sidebars[ $_sidebar_being_rendered ] ) ) {
		$before_title = $wp_registered_sidebars[ $_sidebar_being_rendered ]['before_title'];
		$after_title  = $wp_registered_sidebars[ $_sidebar_being_rendered ]['after_title'];
	} else {
		$before_title = '

'; $after_title = '

'; } $html = ''; if ( ! empty( $attributes['title'] ) ) { $html .= $before_title . esc_html( $attributes['title'] ) . $after_title; } $html .= '
'; foreach ( $block->inner_blocks as $inner_block ) { $html .= $inner_block->render(); } $html .= '
'; return $html; }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。