Changes in trunk/wp-admin/upload.php [12308:12162]
- File:
-
- 1 edited
-
trunk/wp-admin/upload.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/upload.php
r12308 r12162 63 63 } 64 64 65 $location = add_query_arg( array( ' attached' => $attached ) , $location );65 $location = add_query_arg( array( 'detached' => 1, 'attached' => $attached ) , $location ); 66 66 wp_redirect($location); 67 67 exit; … … 77 77 $post_ids = isset($_GET['media']) ? $_GET['media'] : explode(',', $_GET['ids']); 78 78 $doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2']; 79 } else {79 } else 80 80 wp_redirect($_SERVER['HTTP_REFERER']); 81 }82 81 83 82 $location = 'upload.php'; 84 83 if ( $referer = wp_get_referer() ) { 85 84 if ( false !== strpos($referer, 'upload.php') ) 86 $location = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'message', 'ids' , 'posted'), $referer );85 $location = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'message', 'ids'), $referer ); 87 86 } 88 87 … … 120 119 } 121 120 121 $location = remove_query_arg('posted', $location); 122 122 wp_redirect($location); 123 123 exit; … … 135 135 if ( isset($_GET['detached']) ) { 136 136 137 $media_per_page = (int) get_user_option('upload_per_page');138 if ( empty($media_per_page) )139 $media_per_page = 20;140 141 137 if ( !empty($lost) ) { 142 $start = ( (int) $_GET['paged'] - 1 ) * $media_per_page;143 $page_links_total = ceil(count($lost) / $media_per_page);138 $start = ( $_GET['paged'] - 1 ) * 50; 139 $page_links_total = ceil(count($lost) / 50); 144 140 $lost = implode(',', $lost); 145 141 146 $orphans = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE post_type = 'attachment' AND ID IN (%s) LIMIT %d, %d", $lost, $start, $media_per_page ));142 $orphans = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE post_type = 'attachment' AND ID IN ($lost) LIMIT $start, 50" ); 147 143 } else { 148 $start = ( (int) $_GET['paged'] - 1 ) * $media_per_page;149 $orphans = $wpdb->get_results( $wpdb->prepare( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1 LIMIT %d, %d", $start, $media_per_page ));150 $page_links_total = ceil($wpdb->get_var( "SELECT FOUND_ROWS()" ) / $media_per_page);144 $start = ( $_GET['paged'] - 1 ) * 25; 145 $orphans = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1 LIMIT $start, 25" ); 146 $page_links_total = ceil($wpdb->get_var( "SELECT FOUND_ROWS()" ) / 25); 151 147 } 152 148 … … 171 167 <div class="wrap"> 172 168 <?php screen_icon(); ?> 173 <h2><?php echo esc_html( $title ); ?> <a href="media-new.php" class="button add-new-h2"><?php e cho esc_html_x('Add New', 'file'); ?></a> <?php169 <h2><?php echo esc_html( $title ); ?> <a href="media-new.php" class="button add-new-h2"><?php esc_html_e('Add New'); ?></a> <?php 174 170 if ( isset($_GET['s']) && $_GET['s'] ) 175 171 printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( get_search_query() ) ); ?> … … 207 203 $messages[2] = __('Media permanently deleted.'); 208 204 $messages[3] = __('Error saving media attachment.'); 209 $messages[4] = __('Media moved to the trash.') . ' <a href="' . esc_url( wp_nonce_url( 'upload.php?doaction=undo&action=untrash&ids='. (isset($_GET['ids']) ? $_GET['ids'] : ''), "bulk-media" ) ) . '">' . __('Undo') . '</a>';205 $messages[4] = __('Media moved to the trash.') . ' <a href="' . esc_url( wp_nonce_url( 'upload.php?doaction=undo&action=untrash&ids='.$_GET['ids'], "bulk-media" ) ) . '">' . __('Undo?') . '</a>'; 210 206 $messages[5] = __('Media restored from the trash.'); 211 207 … … 309 305 if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) : ?> 310 306 <select name='m'> 311 <option value='0'><?php _e('Show all dates'); ?></option>307 <option<?php selected( @$_GET['m'], 0 ); ?> value='0'><?php _e('Show all dates'); ?></option> 312 308 <?php 313 309 foreach ($arc_result as $arc_row) { … … 434 430 </table> 435 431 436 <?php 432 <?php find_posts_div(); 437 433 438 434 } else { … … 471 467 <br class="clear" /> 472 468 </div> 473 <?php find_posts_div(); ?>474 469 </form> 475 470 <br class="clear" />
Note: See TracChangeset
for help on using the changeset viewer.