diff --git a/wp-admin/edit-attachment-rows.php b/wp-admin/edit-attachment-rows.php index a71b6a45e2..e825f22245 100644 --- a/wp-admin/edit-attachment-rows.php +++ b/wp-admin/edit-attachment-rows.php @@ -27,13 +27,13 @@ if ( have_posts() ) { $bgcolor = ''; add_filter('the_title','wp_specialchars'); while (have_posts()) : the_post(); -$class = 'alternate' == $class ? '' : 'alternate'; +$alt = ( 'alternate' == $alt ) ? '' : 'alternate'; global $current_user; $post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' ); $att_title = _draft_or_post_title(); ?> - post_status ); ?>' valign="top"> + post_status ); ?>' valign="top"> $column_display_name ) {

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') . ''; $action_count = count($actions); $i = 0;