diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php
index e5a42c1711..d1ccc31be8 100644
--- a/wp-includes/comment-template.php
+++ b/wp-includes/comment-template.php
@@ -318,50 +318,52 @@ function comments_popup_script($width=400, $height=400, $file='') {
echo $javascript;
}
-function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Comments', $CSSclass='', $none='Comments Off') {
+function comments_popup_link( $zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $css_class = '', $none = 'Comments Off' ) {
global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post;
if ( is_single() || is_page() )
return;
- $number = get_comments_number($id);
+ $number = get_comments_number( $id );
if ( 0 == $number && 'closed' == $post->comment_status && 'closed' == $post->ping_status ) {
- echo '' . $none . '';
+ echo '' . $none . '';
return;
}
if ( !empty($post->post_password) ) { // if there's a password
- if ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie
- echo(__('Enter your password to view comments'));
+ if ( $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password ) { // and it doesn't match the cookie
+ echo __('Enter your password to view comments');
return;
}
}
- $comments_popup_link = '';
- comments_number($zero, $one, $more, $number);
- $comments_popup_link .= '';
- echo apply_filters('comments_popup_link', $comments_popup_link);
+ $title = attribute_escape( get_the_title() );
+
+ echo apply_filters( 'comments_popup_link_attributes', '' );
+
+ echo ' title="' . sprintf( __('Comment on %s'), $title ) . '">';
+ comments_number( $zero, $one, $more, $number );
+ echo '';
}
?>