diff --git a/wp-admin/upload.php b/wp-admin/upload.php index 2190c138d..e52bab877 100644 --- a/wp-admin/upload.php +++ b/wp-admin/upload.php @@ -337,10 +337,13 @@ foreach ($arc_result as $arc_row) {

ID, true) . '">' . __('Edit') . ''; - $actions['delete'] = "ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . ""; + if ( current_user_can('edit_post', $post->ID) ) + $actions['edit'] = '' . __('Edit') . ''; + if ( current_user_can('delete_post', $post->ID) ) + $actions['delete'] = "ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . ""; $actions['view'] = '' . __('View') . ''; - $actions['attach'] = ''.__('Attach').''; + if ( current_user_can('edit_post', $post->ID) ) + $actions['attach'] = ''.__('Attach').''; $action_count = count($actions); $i = 0; foreach ( $actions as $action => $link ) {