Round out the objects in the Admin Bar -> Add New list

git-svn-id: https://develop.svn.wordpress.org/trunk@17821 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2011-05-06 19:29:54 +00:00
parent 8924e1b7b8
commit bd68475d3f
1 changed files with 15 additions and 0 deletions

View File

@ -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;