_add_block_template_part_area_info

函数


_add_block_template_part_area_info ( $template_info )
Access
Private
参数
  • (array)
    $template_info
    Template to add information to (requires ‘type’ and ‘slug’ fields).
    Required:
返回值
  • (array) Template info.
定义位置
  • wp-includes/block-template-utils.php
    , line 372
引入
5.9.0
弃用

Attempts to add the template part’s area information to the input template.

function _add_block_template_part_area_info( $template_info ) {
	if ( WP_Theme_JSON_Resolver::theme_has_support() ) {
		$theme_data = WP_Theme_JSON_Resolver::get_theme_data()->get_template_parts();
	}

	if ( isset( $theme_data[ $template_info['slug'] ]['area'] ) ) {
		$template_info['title'] = $theme_data[ $template_info['slug'] ]['title'];
		$template_info['area']  = _filter_block_template_part_area( $theme_data[ $template_info['slug'] ]['area'] );
	} else {
		$template_info['area'] = WP_TEMPLATE_PART_AREA_UNCATEGORIZED;
	}

	return $template_info;
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。