Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // In response to post at:
- // http://wptavern.com/a-proposed-enhancement-that-saves-a-mouse-click-when-upgrading-wordpress-plugins
- add_action('admin_menu', 'add_plugin_updates_menu');
- function add_plugin_updates_menu() {
- $update_data = wp_get_update_data();
- // Add "Updates" menu item when plugin updates available.
- if($update_data['counts']['plugins'] > 0) {
- add_plugins_page( 'Not displayed', 'Updates', 'update_plugins', 'plugins.php?plugin_status=upgrade');
- }
- // Add "Pending" menu item when there are comments awaiting moderation.
- $awaiting_mod = wp_count_comments();
- $awaiting_mod = $awaiting_mod->moderated;
- if($awaiting_mod) {
- add_comments_page( 'Not displayed', 'Pending', 'moderate_comments', 'edit-comments.php?comment_status=moderated');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement