[wp-trac] [WordPress Trac] #15406: Add a pending post count indicator to the admin menu

WordPress Trac noreply at wordpress.org
Mon Sep 29 14:41:01 UTC 2014


#15406: Add a pending post count indicator to the admin menu
-------------------------------+---------------------------------
 Reporter:  iign               |       Owner:
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:  Future Release
Component:  Posts, Post Types  |     Version:  3.0.1
 Severity:  trivial            |  Resolution:
 Keywords:  has-patch          |     Focuses:  ui, administration
-------------------------------+---------------------------------
Changes (by nikolov.tmw):

 * keywords:  needs-patch => has-patch


Comment:

 I'm attaching a patch that introduces a new function called
 `pending_posts_bubble()`(naming convention suggestions anyone?) that when
 passed a post type slug, returns:
  - `NULL` if the post type doesn't exist.
  - `false` if the current user is not capable of publishing posts from
 that post type.
  - empty string if there are no pending posts.
  - HTML string for the bubble containing the number of pending posts.

 Behind the scenes the function uses `wp_count_posts()` - that seemed like
 the most appropriate existing function to use.

 `pending_posts_bubble()` is then called in the appropriate places in `wp-
 admin/menu.php`.

 In the screenshot below you can see that the bubble is pretty much the
 standard one(as seen on the Plugins menu item).
 [[Image(https://i.imgur.com/OGb7qW5.png)]]

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


More information about the wp-trac mailing list