Make WordPress Core

Ticket #48772: 48772.diff

File 48772.diff, 1.2 KB (added by donmhico, 5 years ago)
  • src/wp-includes/comment-template.php

    diff --git src/wp-includes/comment-template.php src/wp-includes/comment-template.php
    index 42f3ef2023..6fe97b6e8d 100644
    function comments_number( $zero = false, $one = false, $more = false, $deprecate 
    886886 * Display the language string for the number of comments the current post has.
    887887 *
    888888 * @since 4.0.0
     889 * @since 5.4 Added `$post_id` as the fourth parameter to allow the usage of the function outside the loop.
    889890 *
    890891 * @param string $zero Optional. Text for no comments. Default false.
    891892 * @param string $one  Optional. Text for one comment. Default false.
    892893 * @param string $more Optional. Text for more than one comment. Default false.
     894 * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is the global `$post`.
     895 * @return string Language string for the number of comments a post has.
    893896 */
    894 function get_comments_number_text( $zero = false, $one = false, $more = false ) {
    895         $number = get_comments_number();
     897function get_comments_number_text( $zero = false, $one = false, $more = false, $post_id = 0 ) {
     898        $number = get_comments_number( $post_id );
    896899
    897900        if ( $number > 1 ) {
    898901                if ( false === $more ) {