Changeset 18927
- Timestamp:
- 10/10/2011 06:40:00 PM (13 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/admin-bar.php
r18919 r18927 118 118 ) ); 119 119 120 // Add WordPress.org link 121 $wp_admin_bar->add_menu( array( 122 'parent' => 'wp-logo-secondary', 123 'id' => 'wporg', 124 'title' => __('WordPress.org'), 125 'href' => 'http://wordpress.org', 126 ) ); 127 120 128 // Add codex link 121 129 $wp_admin_bar->add_menu( array( … … 126 134 ) ); 127 135 136 // Add forums link 137 $wp_admin_bar->add_menu( array( 138 'parent' => 'wp-logo-secondary', 139 'id' => 'support-forums', 140 'title' => __('Support Forums'), 141 'href' => 'http://wordpress.org/support/', 142 ) ); 143 128 144 // Add feedback link 129 145 $wp_admin_bar->add_menu( array( … … 132 148 'title' => __('Feedback'), 133 149 'href' => 'http://wordpress.org/support/forum/requests-and-feedback', 134 ) );135 136 // Add forums link137 $wp_admin_bar->add_menu( array(138 'parent' => 'wp-logo-secondary',139 'id' => 'support-forums',140 'title' => __('Support Forums'),141 'href' => 'http://wordpress.org/support/',142 ) );143 144 // Add WordPress.org link145 $wp_admin_bar->add_menu( array(146 'parent' => 'wp-logo-secondary',147 'id' => 'wporg',148 'title' => __('WordPress.org'),149 'href' => 'http://wordpress.org',150 150 ) ); 151 151 } … … 466 466 $primary = $secondary = array(); 467 467 468 foreach ( (array) get_post_types( array( 'show_in_admin_bar' => true ), 'objects' ) as $ptype_obj ) { 469 if ( ! current_user_can( $ptype_obj->cap->edit_posts ) ) 470 continue; 471 472 $key = 'post' == $ptype_obj->name ? 'post-new.php' : 'post-new.php?post_type=' . $ptype_obj->name; 473 $primary[ $key ] = array( $ptype_obj->labels->name_admin_bar, 'new-' . $ptype_obj->name ); 468 $cpts = (array) get_post_types( array( 'show_in_admin_bar' => true ), 'objects' ); 469 470 if ( isset( $cpts['post'] ) && current_user_can( $cpts['post']->cap->edit_posts ) ) { 471 $primary[ 'post-new.php' ] = array( $cpts['post']->labels->name_admin_bar, 'new-post' ); 472 unset( $cpts['post'] ); 474 473 } 475 474 … … 480 479 $primary[ 'link-add.php' ] = array( _x( 'Link', 'add new from admin bar' ), 'new-link' ); 481 480 481 if ( isset( $cpts['page'] ) && current_user_can( $cpts['page']->cap->edit_posts ) ) { 482 $primary[ 'post-new.php?post_type=page' ] = array( $cpts['page']->labels->name_admin_bar, 'new-page' ); 483 unset( $cpts['page'] ); 484 } 485 486 // Add any additional custom post types. 487 foreach ( $cpts as $cpt ) { 488 if ( ! current_user_can( $cpt->cap->edit_posts ) ) 489 continue; 490 491 $key = 'post-new.php?post_type=' . $cpt->name; 492 $primary[ $key ] = array( $cpt->labels->name_admin_bar, 'new-' . $cpt->name ); 493 } 494 482 495 if ( current_user_can( 'create_users' ) || current_user_can( 'promote_users' ) ) 483 496 $secondary[ 'user-new.php' ] = array( _x( 'User', 'add new from admin bar' ), 'new-user' ); 484 485 if ( ! is_multisite() && current_user_can( 'install_themes' ) )486 $secondary[ 'theme-install.php' ] = array( _x( 'Theme', 'add new from admin bar' ), 'new-theme' );487 488 if ( ! is_multisite() && current_user_can( 'install_plugins' ) )489 $secondary[ 'plugin-install.php' ] = array( _x( 'Plugin', 'add new from admin bar' ), 'new-plugin' );490 497 491 498 if ( ! $primary && ! $secondary ) -
trunk/wp-includes/class-wp-admin-bar.php
r18919 r18927 184 184 185 185 // Content related. 186 add_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 50 );187 186 add_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 60 ); 188 187 add_action( 'admin_bar_menu', 'wp_admin_bar_new_content_menu', 70 ); 189 add_action( 'admin_bar_menu', 'wp_admin_bar_shortlink_menu', 80 ); 188 add_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 80 ); 189 add_action( 'admin_bar_menu', 'wp_admin_bar_shortlink_menu', 90 ); 190 190 191 191 if ( ! is_admin() ) {
Note: See TracChangeset
for help on using the changeset viewer.