Last active
December 29, 2015 04:28
-
-
Save zedejose/7614648 to your computer and use it in GitHub Desktop.
Code to add a count bubble of draft posts to the Posts menu.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add a count of draft posts to the Posts menu | |
function zedejose_add_draft_count() { | |
global $menu; | |
$count_posts = wp_count_posts(); | |
$draft_posts = $count_posts->draft; | |
$menu[5][0] = $menu[5][0] . '<span class="update-plugins count-2"><span class="plugin-count">' . (int)$draft_posts . '</span></span>'; | |
} | |
add_action( 'admin_menu', 'zedejose_add_draft_count' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment