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

WordPress Trac wp-trac at lists.automattic.com
Fri Jan 7 08:13:20 UTC 2011


#14084: Custom taxonomy count includes draft & trashed posts
-------------------------------------------------+-------------------------
 Reporter:  lumpysimon                           |       Owner:  garyc40
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  Future
Component:  Taxonomy                             |  Release
 Severity:  normal                               |     Version:  3.0
 Keywords:  has-patch needs-testing 3.2-early    |  Resolution:
  dev-feedback                                   |
-------------------------------------------------+-------------------------
Changes (by garyc40):

 * keywords:  dev-feedback => has-patch needs-testing 3.2-early dev-feedback


Comment:

 My patch addresses the issues with term counts in taxonomy UI as well as
 wp_list_categories().

 - {{{get_object_taxonomies()}}} now accepts a third optional parameter,
 {{{$exclude_builtin}}}, which is used when you want to get a list of only
 custom taxonomies.

 - {{{update_count_callback}}} will automatically be set to
 {{{_update_post_term_count}}} when {{{show_ui}}} is true and
 {{{update_count_callback}}} is an empty string. The edge case is when the
 developer wants to show the UI, but don't want to call
 {{{_update_post_term_count}}}. In this case, {{{update_count_callback =>
 false}}} can be used. However, {{{_updating_post_term_count}}} is the
 expected behavior when {{{show_ui}}} is true. I doubt that this change
 would affect current plugins and themes relying on custom taxonomies.

 - {{{tax_input}}} is properly generated in {{{wp_get_single_post()}}}.
 Without this, {{{update_count_callback}}} isn't called whenever a post
 with custom taxonomies is deleted.

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


More information about the wp-trac mailing list