render_block_core_term_description

函数
render_block_core_term_description ( $attributes )
参数
  • (array) $attributes Block attributes.
    Required:
返回值
  • (string) Returns the description of the current taxonomy term, if available
定义位置
相关方法
register_block_core_term_descriptionrender_block_core_query_paginationrender_block_core_patternrender_block_core_site_taglinerender_block_core_post_terms
引入
-
弃用
-

render_block_core_term_description: 这是一个核心WordPress函数,用于在编辑器中渲染术语描述块。它被用来在网站的前端输出该块的HTML标记。

在服务器上渲染`core/term-description’区块。

function render_block_core_term_description( $attributes ) {
	$term_description = '';

	if ( is_category() || is_tag() || is_tax() ) {
		$term_description = term_description();
	}

	if ( empty( $term_description ) ) {
		return '';
	}

	$extra_attributes   = ( isset( $attributes['textAlign'] ) )
		? array( 'class' => 'has-text-align-' . $attributes['textAlign'] )
		: array();
	$wrapper_attributes = get_block_wrapper_attributes( $extra_attributes );

	return '<div ' . $wrapper_attributes . '>' . $term_description . '</div>';
}

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2026-01-29 09:09:35

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: