From 7e7d8d7cd44430339ae2e169374e7c2745b874fe Mon Sep 17 00:00:00 2001 From: dd32 Date: Sat, 30 Apr 2011 02:22:58 +0000 Subject: [PATCH] Support Edit link on the Admin Bar for Attachments. Fixes #17273 git-svn-id: http://svn.automattic.com/wordpress/trunk@17778 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/admin-bar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index 9b665e1b21..1dbab8e701 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -165,7 +165,7 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) { if ( empty($current_object) ) return; - 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 ) { + 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 ) ) { $wp_admin_bar->add_menu( array( 'id' => 'edit', 'title' => $post_type_object->labels->edit_item, 'href' => get_edit_post_link( $current_object->ID ) ) ); } elseif ( ! empty( $current_object->taxonomy ) && ( $tax = get_taxonomy( $current_object->taxonomy ) ) && current_user_can( $tax->cap->edit_terms ) && $tax->show_ui ) { $wp_admin_bar->add_menu( array( 'id' => 'edit', 'title' => $tax->labels->edit_item, 'href' => get_edit_term_link( $current_object->term_id, $current_object->taxonomy ) ) );