X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/11be8dc178e77d0b46189bbd8e33a216a9b90942..a01a150d87a096c70b6ec80332b7ce89c943eefe:/wp-admin/edit-attachment-rows.php diff --git a/wp-admin/edit-attachment-rows.php b/wp-admin/edit-attachment-rows.php index 42cd3df0..d88316be 100644 --- a/wp-admin/edit-attachment-rows.php +++ b/wp-admin/edit-attachment-rows.php @@ -6,7 +6,9 @@ * @subpackage Administration */ -if ( ! defined('ABSPATH') ) die(); +// don't load directly +if ( !defined('ABSPATH') ) + die('-1'); if ( have_posts() ) { ?> @@ -24,16 +26,22 @@ if ( have_posts() ) { ?> 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_owner = ( get_current_user_id() == $post->post_author ? 'self' : 'other' ); +$att_title = _draft_or_post_title(); ?> post_status ); ?>' valign="top"> @@ -51,7 +59,7 @@ foreach ($posts_columns as $column_name => $column_display_name ) { case 'cb': ?> - + $column_display_name ) { ?> $column_display_name ) { case 'media': ?> - + ?> $column_display_name ) { if ( !empty( $tags ) ) { $out = array(); foreach ( $tags as $c ) - $out[] = " " . wp_specialchars(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . ""; + $out[] = " " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . ""; echo join( ', ', $out ); } else { _e('No Tags'); @@ -131,7 +159,7 @@ foreach ($posts_columns as $column_name => $column_display_name ) { } else { $t_time = get_the_time(__('Y/m/d g:i:s A')); $m_time = $post->post_date; - $time = get_post_time( 'G', true, $post ); + $time = get_post_time( 'G', true, $post, false ); if ( ( abs($t_diff = time() - $time) ) < 86400 ) { if ( $t_diff < 0 ) $h_time = sprintf( __('%s from now'), human_time_diff( $time ) ); @@ -156,7 +184,8 @@ foreach ($posts_columns as $column_name => $column_display_name ) { - + $column_display_name ) { $pending_phrase = sprintf( __('%s pending'), number_format( $left ) ); if ( $left ) echo ''; - comments_number("" . __('0') . '', "" . __('1') . '', "" . __('%') . ''); + comments_number("" . /* translators: comment count link */ _x('0', 'comment count') . '', "" . /* translators: comment count link */ _x('1', 'comment count') . '', "" . /* translators: comment count link: % will be substituted by comment count */ _x('%', 'comment count') . ''); if ( $left ) echo ''; ?> @@ -182,7 +211,7 @@ foreach ($posts_columns as $column_name => $column_display_name ) { case 'actions': ?> $column_display_name ) {
ID) ) { ?> >ID, array(80, 60), true ) ) { + if ( $is_trash ) echo $thumb; + else { ?> - - "> + >">
- ID))); ?> +
>

ID ), $matches ) ) + echo esc_html( strtoupper( $matches[1] ) ); + else + echo strtoupper( str_replace( 'image/', '', get_post_mime_type() ) ); + ?> +

+ 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('" . 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') . ''; + 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 ) { + $title =_draft_or_post_title($post->post_parent); + $actions['view'] = '' . __('View') . ''; + } + $actions = apply_filters( 'media_row_actions', $actions, $post ); $action_count = count($actions); $i = 0; echo '
'; @@ -93,7 +121,7 @@ foreach ($posts_columns as $column_name => $column_display_name ) { echo "$link$sep"; } echo '
'; - ?>

>
+
> - "> | + |
-

+