Changeset 11749 for trunk/wp-admin/edit-attachment-rows.php
- Timestamp:
- 07/30/2009 01:39:34 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-attachment-rows.php
r11380 r11749 29 29 $posts_columns = get_column_headers('upload'); 30 30 $hidden = get_hidden_columns('upload'); 31 while (have_posts()) : the_post(); 31 32 while ( have_posts() ) : the_post(); 33 34 if ( $is_trash && $post->post_status != 'trash' ) 35 continue; 36 elseif ( !$is_trash && $post->post_status == 'trash' ) 37 continue; 38 32 39 $alt = ( 'alternate' == $alt ) ? '' : 'alternate'; 33 40 global $current_user; 34 41 $post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' ); 35 42 $att_title = _draft_or_post_title(); 36 37 43 ?> 38 44 <tr id='post-<?php echo $id; ?>' class='<?php echo trim( $alt . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>' valign="top"> … … 61 67 <td <?php echo $attributes ?>><?php 62 68 if ( $thumb = wp_get_attachment_image( $post->ID, array(80, 60), true ) ) { 63 ?> 64 69 if ( $is_trash ) echo $thumb; 70 else { 71 ?> 65 72 <a href="media.php?action=edit&attachment_id=<?php the_ID(); ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>"> 66 73 <?php echo $thumb; ?> … … 68 75 69 76 <?php } 77 } 70 78 ?></td> 71 79 <?php … … 75 83 case 'media': 76 84 ?> 77 <td <?php echo $attributes ?>><strong>< a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>"><?php echo $att_title; ?></a></strong><br />85 <td <?php echo $attributes ?>><strong><?php if ( $is_trash ) echo $att_title; else { ?><a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>"><?php echo $att_title; ?></a><?php } ?></strong><br /> 78 86 <?php echo strtoupper(preg_replace('/^.*?\.(\w+)$/', '$1', get_attached_file($post->ID))); ?> 79 87 <p> 80 88 <?php 81 89 $actions = array(); 82 if ( current_user_can('edit_post', $post->ID) ) 83 $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>'; 84 if ( current_user_can('delete_post', $post->ID) ) 85 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->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') . "</a>"; 86 $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>'; 90 if ( $is_trash && current_user_can('delete_post', $post->ID) ) { 91 $actions['untrash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=untrash&post=$post->ID", 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a>"; 92 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>"; 93 } else { 94 if ( current_user_can('edit_post', $post->ID) ) 95 $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>'; 96 if ( current_user_can('delete_post', $post->ID) ) 97 $actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=trash&post=$post->ID", 'trash-post_' . $post->ID) . "'>" . __('Trash') . "</a>"; 98 $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>'; 99 } 87 100 $action_count = count($actions); 88 101 $i = 0;
Note: See TracChangeset
for help on using the changeset viewer.