[wp-trac] [WordPress Trac] #39372: Allow count for wp_terms query to count other post statuses as well as published posts

WordPress Trac noreply at wordpress.org
Thu Dec 29 21:36:32 UTC 2016


#39372: Allow count for wp_terms query to count other post statuses as well as
published posts
-------------------------------+------------------------------
 Reporter:  roperjonathan      |       Owner:
     Type:  feature request    |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  General            |     Version:  4.7
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  performance
-------------------------------+------------------------------
Changes (by boonebgorges):

 * keywords:   => reporter-feedback


Comment:

 @roperjonathan Thanks for the ticket, and welcome to WordPress Trac!

 Can you give an example of the syntax you'd like to use in your plugin or
 theme? I'm not sure I understand the use case.

 > At the moment if I want to do this, I have to return all of the terms
 from a taxonomy and then go through each one and count how many posts are
 associated with each term for both published posts and draft posts which
 is a lot more inefficient.

 It may be that WP would have to do the same thing internally, which would
 be just as inefficient :)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39372#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list