Changeset 8682 for trunk/wp-admin/upload.php
- Timestamp:
- 08/20/2008 04:06:36 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/upload.php
r8656 r8682 9 9 /** WordPress Administration Bootstrap */ 10 10 require_once('admin.php'); 11 add_thickbox(); 12 wp_enqueue_script('media-upload'); 11 13 12 14 if (!current_user_can('upload_files')) … … 14 16 15 17 // Handle bulk deletes 16 if ( isset($_GET[' deleteit']) && isset($_GET['delete']) ) {18 if ( isset($_GET['action']) && isset($_GET['media']) ) { 17 19 check_admin_referer('bulk-media'); 18 foreach( (array) $_GET['delete'] as $post_id_del ) { 19 $post_del = & get_post($post_id_del); 20 21 if ( !current_user_can('delete_post', $post_id_del) ) 22 wp_die( __('You are not allowed to delete this post.') ); 23 24 if ( $post_del->post_type == 'attachment' ) 25 if ( ! wp_delete_attachment($post_id_del) ) 26 wp_die( __('Error in deleting...') ); 20 if ( $_GET['action'] == 'delete' ) { 21 foreach( (array) $_GET['media'] as $post_id_del ) { 22 $post_del = & get_post($post_id_del); 23 24 if ( !current_user_can('delete_post', $post_id_del) ) 25 wp_die( __('You are not allowed to delete this post.') ); 26 27 if ( $post_del->post_type == 'attachment' ) 28 if ( ! wp_delete_attachment($post_id_del) ) 29 wp_die( __('Error in deleting...') ); 30 } 31 32 $location = 'upload.php'; 33 if ( $referer = wp_get_referer() ) { 34 if ( false !== strpos($referer, 'upload.php') ) 35 $location = $referer; 36 } 37 38 $location = add_query_arg('message', 2, $location); 39 $location = remove_query_arg('posted', $location); 40 wp_redirect($location); 41 exit; 27 42 } 28 29 $location = 'upload.php';30 if ( $referer = wp_get_referer() ) {31 if ( false !== strpos($referer, 'upload.php') )32 $location = $referer;33 }34 35 $location = add_query_arg('message', 2, $location);36 $location = remove_query_arg('posted', $location);37 wp_redirect($location);38 exit;39 43 } elseif ( !empty($_GET['_wp_http_referer']) ) { 40 44 wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); … … 65 69 printf(__('Comments on %s'), apply_filters( "the_title", $post->post_title)); 66 70 } else { 67 $post_mime_type_label = _c('M anage Media|manage media header');71 $post_mime_type_label = _c('Media|manage media header'); 68 72 if ( isset($_GET['post_mime_type']) && in_array( $_GET['post_mime_type'], array_keys($post_mime_types) ) ) 69 73 $post_mime_type_label = $post_mime_types[$_GET['post_mime_type']][1]; … … 87 91 $h2_tag = isset($_GET['tag']) && $_GET['tag'] ? ' ' . sprintf( __('tagged with “%s”'), single_tag_title('', false) ) : ''; 88 92 $h2_month = isset($_GET['m']) && $_GET['m'] ? ' ' . sprintf( __('during %s'), single_month_title(' ', false) ) : ''; 89 printf( _c( '%1$s%2$s%3$s%4$s%5$s%6$s |You can reorder these: 1: Posts, 2: by {s}, 3: matching {s}, 4: in {s}, 5: tagged with {s}, 6: during {s}' ), $h2_noun, $h2_author, $h2_search, $h2_cat, $h2_tag, $h2_month);93 printf( _c( '%1$s%2$s%3$s%4$s%5$s%6$s (<a href="%7$s" class="thickbox">Add New</a>)|You can reorder these: 1: Posts, 2: by {s}, 3: matching {s}, 4: in {s}, 5: tagged with {s}, 6: during {s}' ), $h2_noun, $h2_author, $h2_search, $h2_cat, $h2_tag, $h2_month, 'media-upload.php?library=false&TB_iframe=true' ); 90 94 } 91 95 ?></h2> … … 156 160 157 161 <div class="alignleft"> 158 <input type="submit" value="<?php _e('Delete'); ?>" name="deleteit" class="button-secondary delete" /> 162 <select name="action"> 163 <option value="" selected><?php _e('Actions'); ?></option> 164 <option value="delete"><?php _e('Delete'); ?></option> 165 </select> 166 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction" class="button-secondary action" /> 159 167 <?php wp_nonce_field('bulk-media'); ?> 160 168 <?php
Note: See TracChangeset
for help on using the changeset viewer.