enqueue_legacy_post_comments_block_styles

函数


enqueue_legacy_post_comments_block_styles ( $block_name )
参数
  • (string)
    $block_name
    Name of the new block type.
    Required:
定义位置
  • wp-includes/blocks/comments.php
    , line 126
引入
弃用

从传统的`core/post-comments’区块中提取样式。这些样式只被该区块的回退所需要。

function enqueue_legacy_post_comments_block_styles( $block_name ) {
	static $are_styles_enqueued = false;

	if ( ! $are_styles_enqueued ) {
		$handles = array(
			'wp-block-post-comments',
			'wp-block-buttons',
			'wp-block-button',
		);
		foreach ( $handles as $handle ) {
			wp_enqueue_block_style( $block_name, array( 'handle' => $handle ) );
		}
		$are_styles_enqueued = true;
	}
}