Ticket #5247: commentspopuplink.patch

File commentspopuplink.patch, 1.5 KB (added by joostdevalk, 4 years ago)

Patch

  • wp-includes/comment-template.php

     
    338338                } 
    339339        } 
    340340 
    341         echo '<a href="'; 
     341        $comments_popup_link = '<a href="'; 
    342342        if ($wpcommentsjavascript) { 
    343343                if ( empty($wpcommentspopupfile) ) 
    344344                        $home = get_option('home'); 
    345345                else 
    346346                        $home = get_option('siteurl'); 
    347                 echo $home . '/' . $wpcommentspopupfile.'?comments_popup='.$id; 
    348                 echo '" onclick="wpopen(this.href); return false"'; 
     347                $comments_popup_link .= $home . '/' . $wpcommentspopupfile.'?comments_popup='.$id; 
     348                $comments_popup_link .= '" onclick="wpopen(this.href); return false"'; 
    349349        } else { // if comments_popup_script() is not in the template, display simple comment link 
    350350                if ( 0 == $number ) 
    351                         echo get_permalink() . '#respond'; 
     351                        $comments_popup_link .= get_permalink() . '#respond'; 
    352352                else 
    353                         comments_link(); 
    354                 echo '"'; 
     353                        $comments_popup_link .=  comments_link(); 
     354                $comments_popup_link .=  '"'; 
    355355        } 
    356356 
    357357        if (!empty($CSSclass)) { 
    358                 echo ' class="'.$CSSclass.'"'; 
     358                $comments_popup_link .= ' class="'.$CSSclass.'"'; 
    359359        } 
    360360        $title = attribute_escape(get_the_title()); 
    361         echo ' title="' . sprintf( __('Comment on %s'), $title ) .'">'; 
     361        $comments_popup_link .= ' title="' . sprintf( __('Comment on %s'), $title ) .'">'; 
    362362        comments_number($zero, $one, $more, $number); 
    363         echo '</a>'; 
     363        $comments_popup_link .= '</a>'; 
     364        echo apply_filters('comments_popup_link', $comments_popup_link); 
    364365} 
    365366 
    366367?>