[wp-trac] [WordPress Trac] #14084: Custom taxonomy count includes draft & trashed posts

WordPress Trac wp-trac at lists.automattic.com
Sun Nov 21 04:46:46 UTC 2010


#14084: Custom taxonomy count includes draft & trashed posts
--------------------------+-------------------------------------------------
 Reporter:  lumpysimon    |       Owner:                
     Type:  defect (bug)  |      Status:  new           
 Priority:  normal        |   Milestone:  Future Release
Component:  Taxonomy      |     Version:  3.0           
 Severity:  normal        |    Keywords:  dev-feedback  
--------------------------+-------------------------------------------------

Comment(by mfields):

 I have witnessed the behavior that lumpysimon has reported.

 If the 'update_count_callback' argument is not defined when a custom
 taxonomy is registered it's value is set to empty and the post count will
 not be updated when post_status is changed, only when published. However,
 if a custom taxonomy's 'update_count_callback' argument is set to
 '_update_post_term_count', the count will be updated when post_status is
 changed from a value of 'publish', 'draft' or 'pending' to a value of
 'publish', 'draft' or 'pending'.

 I'm not sure whether or not it is a good idea to suggest that users set
 the value of 'update_count_callback' to a function marked as private in
 core. Would it be better to have register_taxonomy() set this function for
 the user instead of giving it an empty value?

 In my tests I never witnessed the count being updated when a post's status
 was changed to or from 'trash'. I believe this to be a bug.

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


More information about the wp-trac mailing list