Ticket #14772: 14772-new-post.diff
File 14772-new-post.diff, 2.1 KB (added by , 13 years ago) |
---|
-
wp-includes/admin-bar.php
187 187 } 188 188 } 189 189 190 function wp_admin_bar_new_ content_menu() {190 function wp_admin_bar_new_post_menu() { 191 191 global $wp_admin_bar; 192 192 193 $actions = array(); 194 foreach ( (array) get_post_types( array('show_ui' => true, 'show_in_menu' => true) ) as $ptype ) { 195 $ptype_obj = get_post_type_object( $ptype ); 196 if ( $ptype_obj->show_in_menu !== true || ! current_user_can( $ptype_obj->cap->edit_posts ) ) 197 continue; 198 199 $actions["post-new.php?post_type=$ptype"] = array( $ptype_obj->labels->singular_name, $ptype_obj->cap->edit_posts, "new-$ptype" ); 200 } 201 202 if ( empty( $actions ) ) 203 return; 204 205 $wp_admin_bar->add_menu( array( 'id' => 'new-content', 'title' => __( 'New Content' ), 'href' => '', ) ); 206 207 foreach ( $actions as $link => $action ) { 208 $wp_admin_bar->add_menu( array( 'parent' => 'new-content', 'id' => $action[2], 'title' => $action[0], 'href' => admin_url($link) ) ); 209 } 193 $wp_admin_bar->add_menu( array( 'id' => 'post-new', 'title' => __( 'New Post' ), 'href' => admin_url('post-new.php') ) ); 210 194 } 211 195 212 196 function wp_admin_bar_comments_menu() { -
wp-includes/class-wp-admin-bar.php
175 175 add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_my_account_menu', 20 ); 176 176 add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_my_blogs_menu', 30 ); 177 177 add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_edit_menu', 40 ); 178 add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_new_ content_menu', 50 );178 add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_new_post_menu', 50 ); 179 179 add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_comments_menu', 60 ); 180 180 add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_appearance_menu', 70 ); 181 181 add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_updates_menu', 80 );