wp/wp-includes/blocks/comments-title.php
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
     5  * @package WordPress
     5  * @package WordPress
     6  */
     6  */
     7 
     7 
     8 /**
     8 /**
     9  * Renders the `core/comments-title` block on the server.
     9  * Renders the `core/comments-title` block on the server.
       
    10  *
       
    11  * @since 6.0.0
    10  *
    12  *
    11  * @param array $attributes Block attributes.
    13  * @param array $attributes Block attributes.
    12  *
    14  *
    13  * @return string Return the post comments title.
    15  * @return string Return the post comments title.
    14  */
    16  */
    54 		} elseif ( '1' === $comments_count ) {
    56 		} elseif ( '1' === $comments_count ) {
    55 			$comments_title = __( 'One response' );
    57 			$comments_title = __( 'One response' );
    56 		} else {
    58 		} else {
    57 			$comments_title = sprintf(
    59 			$comments_title = sprintf(
    58 				/* translators: %s: Number of comments. */
    60 				/* translators: %s: Number of comments. */
    59 				_n( '%s responses', '%s responses', $comments_count ),
    61 				_n( '%s response', '%s responses', $comments_count ),
    60 				number_format_i18n( $comments_count )
    62 				number_format_i18n( $comments_count )
    61 			);
    63 			);
    62 		}
    64 		}
    63 	} elseif ( $show_post_title ) {
    65 	} elseif ( $show_post_title ) {
    64 		if ( '1' === $comments_count ) {
    66 		if ( '1' === $comments_count ) {
    82 	);
    84 	);
    83 }
    85 }
    84 
    86 
    85 /**
    87 /**
    86  * Registers the `core/comments-title` block on the server.
    88  * Registers the `core/comments-title` block on the server.
       
    89  *
       
    90  * @since 6.0.0
    87  */
    91  */
    88 function register_block_core_comments_title() {
    92 function register_block_core_comments_title() {
    89 	register_block_type_from_metadata(
    93 	register_block_type_from_metadata(
    90 		__DIR__ . '/comments-title',
    94 		__DIR__ . '/comments-title',
    91 		array(
    95 		array(