WordPress.org

Make WordPress Core

Ticket #4964: comment-template.2.patch

File comment-template.2.patch, 701 bytes (added by Viper007Bond, 7 years ago)

A little safer check

  • wp-includes/comment-template.php

     
    161161        return apply_filters('get_comments_number', $count); 
    162162} 
    163163 
    164 function comments_number( $zero = false, $one = false, $more = false, $deprecated = '' ) { 
     164function comments_number( $zero = false, $one = false, $more = false, $number = '' ) { 
    165165        global $id; 
    166         $number = get_comments_number($id); 
     166        if ( empty($number) ) $number = get_comments_number($id); 
    167167 
    168168        if ( $number > 1 ) 
    169169                $output = str_replace('%', $number, ( false === $more ) ? __('% Comments') : $more);