Changeset 28912 for trunk/src/wp-includes/comment-template.php
- Timestamp:
- 06/29/2014 11:12:34 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment-template.php
r28824 r28912 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 718 } 719 echo get_comments_number_text( $zero, $one, $more ); 720 } 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. … … 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
Note: See TracChangeset
for help on using the changeset viewer.