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
This commit is contained in:
Andrew Nacin 2012-09-23 18:39:03 +00:00
parent 70ad7496a6
commit 5304fd5da8
1 changed files with 3 additions and 2 deletions

View File

@ -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',