on %s', 'applicator' ), $title ); } if ( false === $one ) { /* translators: %s: post title */ $one = sprintf( __( '1 Comment on %s', 'applicator' ), $title ); } if ( false === $more ) { /* translators: 1: Number of comments 2: post title */ $more = _n( '%1$s Comment on %2$s', '%1$s Comments on %2$s', $number, 'applicator' ); $more = sprintf( $more, number_format_i18n( $number ), $title ); } if ( false === $none ) { /* translators: %s: post title */ $none = sprintf( __( 'Comments Off on %s', 'applicator' ), $title ); } $str = ''; if ( 0 == $number && !comments_open() && !pings_open() ) { $str = '' . $none . ''; return $str; } if ( post_password_required() ) { $str = __( 'Enter your password to view comments.', 'applicator' ); return $str; } $str = ' 0 ) ); $str .= apply_filters( 'comments_popup_link_attributes', '' ); $str .= ' title="' . esc_attr( sprintf( __( 'Comment on %s', 'applicator' ), $title ) ) . '">'; $str .= get_comments_number_str( $zero, $one, $more ); $str .= ''; return $str; } // Modifies WordPress's built-in comments_number() function to return string instead of echo function get_comments_number_str( $zero = false, $one = false, $more = false, $deprecated = '' ) { if ( !empty( $deprecated ) ) _deprecated_argument( __FUNCTION__, '1.3' ); $number = get_comments_number(); if ( $number > 1 ) $output = str_replace('%', number_format_i18n($number), ( false === $more ) ? __( '% Comments', 'applicator' ) : $more); elseif ( $number == 0 ) $output = ( false === $zero ) ? __( 'No Comments', 'applicator' ) : $zero; else // must be one $output = ( false === $one ) ? __( '1 Comment', 'applicator' ) : $one; return apply_filters('comments_number', $output, $number); }