X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/672d6bc6da735e745275ef7a86341dc1178da8d2..312084b5d95c21feb519ff03decf948420e1f6fa:/wp-admin/edit-attachment-rows.php diff --git a/wp-admin/edit-attachment-rows.php b/wp-admin/edit-attachment-rows.php index 4922eed2..1b972a9f 100644 --- a/wp-admin/edit-attachment-rows.php +++ b/wp-admin/edit-attachment-rows.php @@ -30,12 +30,18 @@ add_filter('the_title','esc_html'); $alt = ''; $posts_columns = get_column_headers('upload'); $hidden = get_hidden_columns('upload'); -while (have_posts()) : the_post(); + +while ( have_posts() ) : the_post(); + +if ( $is_trash && $post->post_status != 'trash' ) + continue; +elseif ( !$is_trash && $post->post_status == 'trash' ) + continue; + $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"> @@ -53,7 +59,7 @@ foreach ($posts_columns as $column_name => $column_display_name ) { case 'cb': ?> - + ID) ) { ?> $column_display_name ) { ?> >ID, array(80, 60), true ) ) { + if ( $is_trash ) echo $thumb; + else { ?> - $column_display_name ) { case 'media': ?> - >
+ >
ID))); ?>

ID) ) + if ( current_user_can('edit_post', $post->ID) && !$is_trash ) $actions['edit'] = '' . __('Edit') . ''; - if ( current_user_can('delete_post', $post->ID) ) - $actions['delete'] = "ID) . "' onclick=\"if ( confirm('" . esc_js(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') . ''; + if ( current_user_can('delete_post', $post->ID) ) { + if ( $is_trash ) + $actions['untrash'] = "ID) . "'>" . __('Restore') . ""; + elseif ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) + $actions['trash'] = "ID) . "'>" . __('Trash') . ""; + if ( $is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH ) { + $delete_ays = (!$is_trash && !MEDIA_TRASH) ? " onclick='return showNotice.warn();'" : ''; + $actions['delete'] = "ID) . "'>" . __('Delete Permanently') . ""; + } + } + if ( !$is_trash ) + $actions['view'] = '' . __('View') . ''; + $actions = apply_filters( 'media_row_actions', $actions, $post ); $action_count = count($actions); $i = 0; echo '

'; @@ -158,7 +176,8 @@ foreach ($posts_columns as $column_name => $column_display_name ) { - >  + >
+ $column_display_name ) { +