WordPress.org

Make WordPress Core

Ticket #10177: get-comments-number-text.diff

File get-comments-number-text.diff, 1.4 KB (added by nbachiyski, 6 years ago)
  • wp-includes/comment-template.php

     
    542542 * @param string $zero Text for no comments 
    543543 * @param string $one Text for one comment 
    544544 * @param string $more Text for more than one comment 
    545  * @param string $deprecated Not used. 
    546545 */ 
    547 function comments_number( $zero = false, $one = false, $more = false, $deprecated = '' ) { 
     546function comments_number() { 
     547        $args = func_get_args(); 
     548        echo call_user_func_array( 'get_comments_number_text', $args ); 
     549} 
     550 
     551/** 
     552 * Return the language string for the number of comments the current post has. 
     553 * 
     554 * @since 2.9 
     555 * @uses $id 
     556 * @uses apply_filters() Calls the 'comments_number' hook on the output and number of comments respectively. 
     557 * 
     558 * @param string $zero Text for no comments 
     559 * @param string $one Text for one comment 
     560 * @param string $more Text for more than one comment 
     561 */ 
     562function get_comments_number_text( $zero = false, $one = false, $more = false ) { 
    548563        global $id; 
    549564        $number = get_comments_number($id); 
    550565 
     
    555570        else // must be one 
    556571                $output = ( false === $one ) ? __('1 Comment') : $one; 
    557572 
    558         echo apply_filters('comments_number', $output, $number); 
     573        return apply_filters('comments_number', $output, $number); 
    559574} 
    560575 
    561576/**