From a5aa17b2fc43a6f09652da804b7285b4733a639d Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Mon, 10 Dec 2007 20:49:46 +0000 Subject: [PATCH] Revert [6368]. Fixes #5448, fixes #5247 by adding a new filter to hook in specifically to add attributes, rather than filtering the whole thing. Minor formatting cleanup of comments_popup_link. git-svn-id: https://develop.svn.wordpress.org/trunk@6372 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/comment-template.php | 42 +++++++++++++++++--------------- 1 file changed, 22 insertions(+), 20 deletions(-) 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 ''; } ?>