From 5304fd5da8368a3cefc2faac2836f414cd246160 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sun, 23 Sep 2012 18:39:03 +0000 Subject: [PATCH] Check a post type's show_in_admin_bar property for 'View' and 'Edit' object links. Previously show_in_admin_bar was only checked for the add new menu. fixes #20504. git-svn-id: http://core.svn.wordpress.org/trunk@21957 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/admin-bar.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index a4e01a51f7..d7ba49d3c6 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -429,7 +429,8 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) { && 'add' != $current_screen->action && ( $post_type_object = get_post_type_object( $post->post_type ) ) && current_user_can( $post_type_object->cap->read_post, $post->ID ) - && ( $post_type_object->public ) ) + && ( $post_type_object->public ) + && ( $post_type_object->show_in_admin_bar ) ) { $wp_admin_bar->add_menu( array( 'id' => 'view', @@ -456,7 +457,7 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) { if ( ! empty( $current_object->post_type ) && ( $post_type_object = get_post_type_object( $current_object->post_type ) ) && current_user_can( $post_type_object->cap->edit_post, $current_object->ID ) - && ( $post_type_object->show_ui || 'attachment' == $current_object->post_type ) ) + && $post_type_object->show_ui && $post_type_object->show_in_admin_bar ) { $wp_admin_bar->add_menu( array( 'id' => 'edit',