[wp-trac] Re: [WordPress Trac] #4964: Bring back the 4th parameter in comments_number()

WordPress Trac wp-trac at lists.automattic.com
Sun Dec 16 21:21:53 GMT 2007


#4964: Bring back the 4th parameter in comments_number()
-----------------------------------+----------------------------------------
 Reporter:  Viper007Bond           |        Owner:  anonymous
     Type:  enhancement            |       Status:  closed   
 Priority:  lowest                 |    Milestone:           
Component:  Template               |      Version:  2.3      
 Severity:  trivial                |   Resolution:  invalid  
 Keywords:  has-patch 2nd-opinion  |  
-----------------------------------+----------------------------------------
Changes (by darkdragon):

  * status:  new => closed
  * resolution:  => invalid
  * milestone:  2.4 =>

Comment:

 Instead of replicating the entire function, just hook into
 'get_comments_number', global the id, and return the number that would
 otherwise be used instead of $number parameter.

 {{{
 function change_comment_count($count)
 {
     global $id;

     if($id === 1)
         return $count+1;

     return $count;
 }

 add_filter('get_comments_number', 'change_comment_count');
 }}}

 I think the whole point of the hook was to solve the old functionality
 while not completely replacing it.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4964#comment:7>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list