From f824fbe47f94cb7770f74e22bfeb8cd8518b9d5f Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 6 May 2011 19:29:54 +0000 Subject: [PATCH] Round out the objects in the Admin Bar -> Add New list git-svn-id: http://svn.automattic.com/wordpress/trunk@17821 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/admin-bar.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index 1dbab8e70..90e2a0f86 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -186,6 +186,21 @@ function wp_admin_bar_new_content_menu( $wp_admin_bar ) { $actions[ 'post-new.php?post_type=' . $ptype_obj->name ] = array( $ptype_obj->labels->singular_name, $ptype_obj->cap->edit_posts, 'new-' . $ptype_obj->name ); } + if ( current_user_can( 'upload_files' ) ) + $actions[ 'upload.php' ] = array( __( 'Media' ), 'upload_files', 'new-media' ); + + if ( current_user_can( 'manage_links' ) ) + $actions[ 'link-add.php' ] = array( __( 'Link' ), 'manage_links', 'new-link' ); + + if ( current_user_can( 'create_users' ) || current_user_can( 'promote_users' ) ) + $actions[ 'user-new.php' ] = array( __( 'User' ), 'create_users', 'new-user' ); + + if ( ! is_multisite() && current_user_can( 'install_themes' ) ) + $actions[ 'theme-install.php' ] = array( __( 'Theme' ), 'install_themes', 'new-theme' ); + + if ( ! is_multisite() && current_user_can( 'install_plugins' ) ) + $actions[ 'plugin-install.php' ] = array( __( 'Plugin' ), 'install_plugins', 'new-plugin' ); + if ( empty( $actions ) ) return;