Ticket #10177: 10177.2.diff
File 10177.2.diff, 1.9 KB (added by , 11 years ago) |
---|
-
src/wp-includes/comment-template.php
713 713 * @param string $deprecated Not used. 714 714 */ 715 715 function comments_number( $zero = false, $one = false, $more = false, $deprecated = '' ) { 716 if ( ! empty( $deprecated ) )716 if ( ! empty( $deprecated ) ) { 717 717 _deprecated_argument( __FUNCTION__, '1.3' ); 718 } 719 echo get_comments_number_text( $zero, $one, $more ); 720 } 718 721 722 /** 723 * Display the language string for the number of comments the current post has. 724 * 725 * @since 4.0.0 726 * 727 * @param string $zero Optional. Text for no comments. Default false. 728 * @param string $one Optional. Text for one comment. Default false. 729 * @param string $more Optional. Text for more than one comment. Default false. 730 */ 731 function get_comments_number_text( $zero = false, $one = false, $more = false ) { 719 732 $number = get_comments_number(); 720 733 721 if ( $number > 1 ) 722 $output = str_replace( '%', number_format_i18n($number), ( false === $more ) ? __('% Comments') : $more);723 elseif ( $number == 0 )724 $output = ( false === $zero ) ? __( 'No Comments') : $zero;725 else// must be one726 $output = ( false === $one ) ? __( '1 Comment') : $one;727 734 if ( $number > 1 ) { 735 $output = str_replace( '%', number_format_i18n( $number ), ( false === $more ) ? __( '% Comments' ) : $more ); 736 } elseif ( $number == 0 ) { 737 $output = ( false === $zero ) ? __( 'No Comments' ) : $zero; 738 } else { // must be one 739 $output = ( false === $one ) ? __( '1 Comment' ) : $one; 740 } 728 741 /** 729 742 * Filter the comments count for display. 730 743 * … … 736 749 * is equal to 0, 1, or 1+. 737 750 * @param int $number The number of post comments. 738 751 */ 739 echoapply_filters( 'comments_number', $output, $number );752 return apply_filters( 'comments_number', $output, $number ); 740 753 } 741 754 742 755 /**