wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi
render_block_core_post_comments_count › WordPress Function
Da6.9.0
Deprecaton/a
› render_block_core_post_comments_count ( $attributes, $content, $block )
| Parametri: (3) |
|
| Ritorna: |
|
| Definito a: |
|
| Codex: |
Renders the `core/post-comments-count` block on the server.
Sorgenti
function render_block_core_post_comments_count( $attributes, $content, $block ) {
if ( ! isset( $block->context['postId'] ) ) {
return '';
}
$classes = '';
if ( isset( $attributes['textAlign'] ) ) {
$classes .= 'has-text-align-' . $attributes['textAlign'];
}
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
return sprintf(
'<div %1$s>%2$s</div>',
$wrapper_attributes,
get_comments_number( $block->context['postId'] )
);
}