Changeset 11807
- Timestamp:
- 08/12/2009 10:57:15 AM (15 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-pages.php
r11779 r11807 14 14 15 15 // Handle bulk actions 16 if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {16 if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) || isset($_GET['bulk_edit']) ) { 17 17 check_admin_referer('bulk-pages'); 18 19 if (isset($_GET['delete_all']) || isset($_GET['delete_all2'])) { 20 $post_status = $wpdb->escape($_GET['post_status']); 21 $post_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_status = '$post_status'" ); 18 $sendback = wp_get_referer(); 19 20 if ( strpos($sendback, 'page.php') !== false ) 21 $sendback = admin_url('page-new.php'); 22 23 if ( isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) { 24 $post_status = preg_replace('/[^a-z0-9_-]+/i', '', $_GET['post_status']); 25 $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_status = %s", $post_status ) ); 22 26 $doaction = 'delete'; 23 } elseif ( ($_GET['action'] != -1 || $_GET['action2'] != -1) && isset($_GET['post'])) {24 $post_ids = $_GET['post'];27 } elseif ( ($_GET['action'] != -1 || $_GET['action2'] != -1) && isset($_GET['post']) ) { 28 $post_ids = array_map( 'intval', (array) $_GET['post'] ); 25 29 $doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2']; 26 } else wp_redirect($_SERVER['HTTP_REFERER']); 30 } else { 31 wp_redirect( admin_url('edit-pages.php') ); 32 } 27 33 28 34 switch ( $doaction ) { … … 38 44 $trashed++; 39 45 } 46 $sendback = add_query_arg('trashed', $trashed, $sendback); 40 47 break; 41 48 case 'untrash': … … 43 50 foreach( (array) $post_ids as $post_id ) { 44 51 if ( !current_user_can('delete_page', $post_id) ) 45 wp_die( __('You are not allowed to re move this page from the trash.') );52 wp_die( __('You are not allowed to restore this page from the trash.') ); 46 53 47 54 if ( !wp_untrash_post($post_id) ) 48 wp_die( __('Error in re moving from trash...') );55 wp_die( __('Error in restoring from trash...') ); 49 56 50 57 $untrashed++; 51 58 } 59 $sendback = add_query_arg('untrashed', $untrashed, $sendback); 52 60 break; 53 61 case 'delete': 54 62 $deleted = 0; 55 foreach( (array) $post_ids as $post_id _del) {56 $post_del = & get_post($post_id _del);57 58 if ( !current_user_can('delete_page', $post_id _del) )63 foreach( (array) $post_ids as $post_id ) { 64 $post_del = & get_post($post_id); 65 66 if ( !current_user_can('delete_page', $post_id) ) 59 67 wp_die( __('You are not allowed to delete this page.') ); 60 68 61 69 if ( $post_del->post_type == 'attachment' ) { 62 if ( ! wp_delete_attachment($post_id _del) )70 if ( ! wp_delete_attachment($post_id) ) 63 71 wp_die( __('Error in deleting...') ); 64 72 } else { 65 if ( !wp_delete_post($post_id _del) )73 if ( !wp_delete_post($post_id) ) 66 74 wp_die( __('Error in deleting...') ); 67 75 } 68 76 $deleted++; 69 77 } 78 $sendback = add_query_arg('deleted', $deleted, $sendback); 70 79 break; 71 80 case 'edit': 72 if ( -1 == $_GET['_status'] ) { 73 $_GET['post_status'] = null; 74 unset($_GET['_status'], $_GET['post_status']); 75 } else { 76 $_GET['post_status'] = $_GET['_status']; 81 $_GET['post_type'] = 'page'; 82 $done = bulk_edit_posts($_GET); 83 84 if ( is_array($done) ) { 85 $done['updated'] = count( $done['updated'] ); 86 $done['skipped'] = count( $done['skipped'] ); 87 $done['locked'] = count( $done['locked'] ); 88 $sendback = add_query_arg( $done, $sendback ); 77 89 } 78 79 $done = bulk_edit_posts($_GET);80 90 break; 81 91 } 82 92 83 $sendback = wp_get_referer(); 84 if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('page-new.php'); 85 elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); 86 if ( isset($done) ) { 87 $done['updated'] = count( $done['updated'] ); 88 $done['skipped'] = count( $done['skipped'] ); 89 $done['locked'] = count( $done['locked'] ); 90 $sendback = add_query_arg( $done, $sendback ); 91 } 92 if ( isset($deleted) ) 93 $sendback = add_query_arg('deleted', $deleted, $sendback); 94 elseif ( isset($trashed) ) 95 $sendback = add_query_arg('trashed', $trashed, $sendback); 96 elseif ( isset($untrashed) ) 97 $sendback = add_query_arg('untrashed', $untrashed, $sendback); 93 if ( isset($_GET['action']) ) 94 $sendback = remove_query_arg( array('action', 'action2', 'post_parent', 'page_template', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view', 'post_type'), $sendback ); 95 98 96 wp_redirect($sendback); 99 97 exit(); … … 182 180 endif; ?> 183 181 184 <form id="posts-filter" action=" " method="get">182 <form id="posts-filter" action="<?php echo admin_url('edit-pages.php'); ?>" method="get"> 185 183 <ul class="subsubsub"> 186 184 <?php -
trunk/wp-admin/edit.php
r11779 r11807 22 22 23 23 // Handle bulk actions 24 if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {24 if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) || isset($_GET['bulk_edit']) ) { 25 25 check_admin_referer('bulk-posts'); 26 26 $sendback = wp_get_referer(); 27 28 if ( strpos($sendback, 'post.php') !== false ) 29 $sendback = admin_url('post-new.php'); 30 27 31 if ( isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) { 28 $post_status = $wpdb->escape($_GET['post_status']);29 $post_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_type='post' AND post_status = '$post_status'");32 $post_status = preg_replace('/[^a-z0-9_-]+/i', '', $_GET['post_status']); 33 $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type='post' AND post_status = %s", $post_status ) ); 30 34 $doaction = 'delete'; 31 } elseif ( ($_GET['action'] != -1 || $_GET['action2'] != -1) && isset($_GET['post'])) {32 $post_ids = $_GET['post'];35 } elseif ( ($_GET['action'] != -1 || $_GET['action2'] != -1) && isset($_GET['post']) ) { 36 $post_ids = array_map( 'intval', (array) $_GET['post'] ); 33 37 $doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2']; 34 } else wp_redirect($_SERVER['HTTP_REFERER']); 35 38 } else { 39 wp_redirect( admin_url('edit.php') ); 40 } 41 36 42 switch ( $doaction ) { 37 43 case 'trash': 38 44 $trashed = 0; 39 45 foreach( (array) $post_ids as $post_id ) { 40 $post_del = & get_post($post_id); 41 42 if ( !current_user_can('delete_post', $post_id_del) ) 46 if ( !current_user_can('delete_post', $post_id) ) 43 47 wp_die( __('You are not allowed to move this post to the trash.') ); 44 48 … … 48 52 $trashed++; 49 53 } 54 $sendback = add_query_arg('trashed', $trashed, $sendback); 50 55 break; 51 56 case 'untrash': 52 57 $untrashed = 0; 53 58 foreach( (array) $post_ids as $post_id ) { 54 $post_del = & get_post($post_id); 55 56 if ( !current_user_can('delete_post', $post_id_del) ) 57 wp_die( __('You are not allowed to remove this post from the trash.') ); 59 if ( !current_user_can('delete_post', $post_id) ) 60 wp_die( __('You are not allowed to restore this post from the trash.') ); 58 61 59 62 if ( !wp_untrash_post($post_id) ) 60 wp_die( __('Error in re moving from trash...') );63 wp_die( __('Error in restoring from trash...') ); 61 64 62 65 $untrashed++; 63 66 } 67 $sendback = add_query_arg('untrashed', $untrashed, $sendback); 64 68 break; 65 69 case 'delete': 66 70 $deleted = 0; 67 foreach( (array) $post_ids as $post_id _del) {68 $post_del = & get_post($post_id _del);69 70 if ( !current_user_can('delete_post', $post_id _del) )71 foreach( (array) $post_ids as $post_id ) { 72 $post_del = & get_post($post_id); 73 74 if ( !current_user_can('delete_post', $post_id) ) 71 75 wp_die( __('You are not allowed to delete this post.') ); 72 76 73 77 if ( $post_del->post_type == 'attachment' ) { 74 if ( ! wp_delete_attachment($post_id _del) )78 if ( ! wp_delete_attachment($post_id) ) 75 79 wp_die( __('Error in deleting...') ); 76 80 } else { 77 if ( !wp_delete_post($post_id _del) )81 if ( !wp_delete_post($post_id) ) 78 82 wp_die( __('Error in deleting...') ); 79 83 } 80 84 $deleted++; 81 85 } 86 $sendback = add_query_arg('deleted', $deleted, $sendback); 82 87 break; 83 88 case 'edit': 84 if ( -1 == $_GET['_status'] ) { 85 $_GET['post_status'] = null; 86 unset($_GET['_status'], $_GET['post_status']); 87 } else { 88 $_GET['post_status'] = $_GET['_status']; 89 $done = bulk_edit_posts($_GET); 90 91 if ( is_array($done) ) { 92 $done['updated'] = count( $done['updated'] ); 93 $done['skipped'] = count( $done['skipped'] ); 94 $done['locked'] = count( $done['locked'] ); 95 $sendback = add_query_arg( $done, $sendback ); 89 96 } 90 91 $done = bulk_edit_posts($_GET);92 97 break; 93 98 } 94 99 95 $sendback = wp_get_referer(); 96 if ( strpos($sendback, 'post.php') !== false ) $sendback = admin_url('post-new.php'); 97 elseif ( strpos($sendback, 'attachments.php') !== false ) $sendback = admin_url('attachments.php'); 98 if ( isset($done) ) { 99 $done['updated'] = count( $done['updated'] ); 100 $done['skipped'] = count( $done['skipped'] ); 101 $done['locked'] = count( $done['locked'] ); 102 $sendback = add_query_arg( $done, $sendback ); 103 } 104 if ( isset($deleted) ) 105 $sendback = add_query_arg('deleted', $deleted, $sendback); 106 elseif ( isset($trashed) ) 107 $sendback = add_query_arg('trashed', $trashed, $sendback); 108 elseif ( isset($untrashed) ) 109 $sendback = add_query_arg('untrashed', $untrashed, $sendback); 100 if ( isset($_GET['action']) ) 101 $sendback = remove_query_arg( array('action', 'action2', 'cat', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view', 'post_type'), $sendback ); 102 110 103 wp_redirect($sendback); 111 104 exit(); … … 180 173 <?php } ?> 181 174 182 <form id="posts-filter" action=" " method="get">175 <form id="posts-filter" action="<?php echo admin_url('edit.php'); ?>" method="get"> 183 176 184 177 <ul class="subsubsub"> -
trunk/wp-admin/includes/post.php
r11796 r11807 237 237 } 238 238 239 if ( -1 == $post_data['_status'] ) { 240 $post_data['post_status'] = null; 241 unset($post_data['post_status']); 242 } else { 243 $post_data['post_status'] = $post_data['_status']; 244 } 245 unset($post_data['_status']); 246 239 247 $post_IDs = array_map( 'intval', (array) $post_data['post'] ); 240 248 … … 299 307 $updated[] = wp_update_post( $post_data ); 300 308 301 if ( current_user_can( 'edit_others_posts' ) && isset( $post_data['sticky']) ) {309 if ( isset( $post_data['sticky'] ) && current_user_can( 'edit_others_posts' ) ) { 302 310 if ( 'sticky' == $post_data['sticky'] ) 303 311 stick_post( $post_ID ); -
trunk/wp-admin/page.php
r11749 r11807 53 53 $location = explode('#', $location); 54 54 $location = $location[0] . '#postcustom'; 55 } elseif ($action == 'editattachment') {56 $location = 'attachments.php';57 55 } else { 58 56 $location = add_query_arg( 'message', 1, get_edit_post_link( $page_ID, 'url' ) ); … … 83 81 $post = get_post_to_edit($page_ID); 84 82 85 if ( empty($post->ID) ) wp_die( __('You attempted to edit a page that doesn’t exist. Perhaps it was deleted?') ); 86 if ( $post->post_status == 'trash' ) wp_die( __('You can’t edit this page because it is in the Trash. Please move it out of the Trash and try again.') ); 83 if ( empty($post->ID) ) 84 wp_die( __('You attempted to edit a page that doesn’t exist. Perhaps it was deleted?') ); 85 86 if ( !current_user_can('edit_page', $page_ID) ) 87 wp_die( __('You are not allowed to edit this page.') ); 88 89 if ( 'trash' == $post->post_status ) 90 wp_die( __('You can’t edit this page because it is in the Trash. Please move it out of the Trash and try again.') ); 87 91 88 92 if ( 'page' != $post->post_type ) { … … 98 102 wp_enqueue_script('word-count'); 99 103 100 if ( current_user_can('edit_page', $page_ID) ) { 101 if ( $last = wp_check_post_lock( $post->ID ) ) { 102 $last_user = get_userdata( $last ); 103 $last_user_name = $last_user ? $last_user->display_name : __('Somebody'); 104 $message = sprintf( __( 'Warning: %s is currently editing this page' ), esc_html( $last_user_name ) ); 105 $message = str_replace( "'", "\'", "<div class='error'><p>$message</p></div>" ); 106 add_action('admin_notices', create_function( '', "echo '$message';" ) ); 107 } else { 108 wp_set_post_lock( $post->ID ); 109 wp_enqueue_script('autosave'); 110 } 111 } 112 113 if ( !current_user_can('edit_page', $page_ID) ) 114 die ( __('You are not allowed to edit this page.') ); 104 if ( $last = wp_check_post_lock( $post->ID ) ) { 105 $last_user = get_userdata( $last ); 106 $last_user_name = $last_user ? $last_user->display_name : __('Somebody'); 107 $message = sprintf( __( 'Warning: %s is currently editing this page' ), esc_html( $last_user_name ) ); 108 $message = str_replace( "'", "\'", "<div class='error'><p>$message</p></div>" ); 109 add_action('admin_notices', create_function( '', "echo '$message';" ) ); 110 } else { 111 wp_set_post_lock( $post->ID ); 112 wp_enqueue_script('autosave'); 113 } 115 114 116 115 include('edit-page-form.php'); … … 143 142 144 143 case 'trash': 145 $post_id = (isset($_GET['post']))? intval($_GET['post']) : intval($_POST['post_ID']);144 $post_id = isset($_GET['post']) ? intval($_GET['post']) : intval($_POST['post_ID']); 146 145 check_admin_referer('trash-page_' . $post_id); 147 146 … … 152 151 153 152 if ( !wp_trash_post($post_id) ) 154 wp_die( __('Error in removing fromtrash...') );153 wp_die( __('Error in moving to trash...') ); 155 154 156 155 $sendback = wp_get_referer(); 157 if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('edit-pages.php?trashed=1'); 158 elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); 159 else $sendback = add_query_arg('trashed', 1, $sendback); 156 if ( strpos($sendback, 'page.php') !== false ) 157 $sendback = admin_url('edit-pages.php?trashed=1'); 158 else 159 $sendback = add_query_arg('trashed', 1, $sendback); 160 160 161 wp_redirect($sendback); 161 162 exit(); … … 163 164 164 165 case 'untrash': 165 $post_id = (isset($_GET['post']))? intval($_GET['post']) : intval($_POST['post_ID']);166 $post_id = isset($_GET['post']) ? intval($_GET['post']) : intval($_POST['post_ID']); 166 167 check_admin_referer('untrash-page_' . $post_id); 167 168 … … 169 170 170 171 if ( !current_user_can('delete_page', $page_id) ) 171 wp_die( __('You are not allowed to remove this page formthe trash.') );172 wp_die( __('You are not allowed to move this page out of the trash.') ); 172 173 173 174 if ( !wp_untrash_post($post_id) ) 174 wp_die( __('Error in re moving from trash...') );175 wp_die( __('Error in restoring from trash...') ); 175 176 176 177 $sendback = wp_get_referer(); 177 if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('edit-pages.php?untrashed=1'); 178 elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); 179 else $sendback = add_query_arg('untrashed', 1, $sendback); 178 if ( strpos($sendback, 'page.php') !== false ) 179 $sendback = admin_url('edit-pages.php?untrashed=1'); 180 else 181 $sendback = add_query_arg('untrashed', 1, $sendback); 182 180 183 wp_redirect($sendback); 181 184 exit(); … … 183 186 184 187 case 'delete': 185 $page_id = (isset($_GET['post']))? intval($_GET['post']) : intval($_POST['post_ID']);188 $page_id = isset($_GET['post']) ? intval($_GET['post']) : intval($_POST['post_ID']); 186 189 check_admin_referer('delete-page_' . $page_id); 187 190 … … 200 203 201 204 $sendback = wp_get_referer(); 202 if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('edit-pages.php?deleted=1'); 203 elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); 204 else $sendback = add_query_arg('deleted', 1, $sendback); 205 if ( strpos($sendback, 'page.php') !== false ) 206 $sendback = admin_url('edit-pages.php?deleted=1'); 207 else 208 $sendback = add_query_arg('deleted', 1, $sendback); 209 205 210 wp_redirect($sendback); 206 211 exit(); -
trunk/wp-admin/post.php
r11749 r11807 56 56 $location = explode('#', $location); 57 57 $location = $location[0] . '#postcustom'; 58 } elseif ($action == 'editattachment') {59 $location = 'attachments.php';60 58 } elseif ( 'post-quickpress-save-cont' == $_POST['action'] ) { 61 59 $location = "post.php?action=edit&post=$post_ID&message=7"; … … 116 114 $post = get_post($post_ID); 117 115 118 if ( empty($post->ID) ) wp_die( __('You attempted to edit a post that doesn’t exist. Perhaps it was deleted?') ); 119 if ( $post->post_status == 'trash' ) wp_die( __('You can’t edit this post because it is in the Trash. Please move it out of the Trash and try again.') ); 116 if ( empty($post->ID) ) 117 wp_die( __('You attempted to edit a post that doesn’t exist. Perhaps it was deleted?') ); 118 119 if ( !current_user_can('edit_post', $post_ID) ) 120 wp_die( __('You are not allowed to edit this post.') ); 121 122 if ( 'trash' == $post->post_status ) 123 wp_die( __('You can’t edit this post because it is in the Trash. Please restore it and try again.') ); 120 124 121 125 if ( 'post' != $post->post_type ) { … … 133 137 enqueue_comment_hotkeys_js(); 134 138 135 if ( current_user_can('edit_post', $post_ID) ) { 136 if ( $last = wp_check_post_lock( $post->ID ) ) { 137 $last_user = get_userdata( $last ); 138 $last_user_name = $last_user ? $last_user->display_name : __('Somebody'); 139 $message = sprintf( __( 'Warning: %s is currently editing this post' ), esc_html( $last_user_name ) ); 140 $message = str_replace( "'", "\'", "<div class='error'><p>$message</p></div>" ); 141 add_action('admin_notices', create_function( '', "echo '$message';" ) ); 142 } else { 143 wp_set_post_lock( $post->ID ); 144 wp_enqueue_script('autosave'); 145 } 139 if ( $last = wp_check_post_lock( $post->ID ) ) { 140 $last_user = get_userdata( $last ); 141 $last_user_name = $last_user ? $last_user->display_name : __('Somebody'); 142 $message = sprintf( __( 'Warning: %s is currently editing this post' ), esc_html( $last_user_name ) ); 143 $message = str_replace( "'", "\'", "<div class='error'><p>$message</p></div>" ); 144 add_action('admin_notices', create_function( '', "echo '$message';" ) ); 145 } else { 146 wp_set_post_lock( $post->ID ); 147 wp_enqueue_script('autosave'); 146 148 } 147 149 148 150 $title = __('Edit Post'); 149 150 if ( !current_user_can('edit_post', $post_ID) )151 die ( __('You are not allowed to edit this post.') );152 153 151 $post = get_post_to_edit($post_ID); 154 152 … … 184 182 185 183 case 'trash': 186 $post_id = (isset($_GET['post']))? intval($_GET['post']) : intval($_POST['post_ID']);184 $post_id = isset($_GET['post']) ? intval($_GET['post']) : intval($_POST['post_ID']); 187 185 check_admin_referer('trash-post_' . $post_id); 188 186 … … 196 194 197 195 $sendback = wp_get_referer(); 198 if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('edit.php?trashed=1'); 199 elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); 200 else $sendback = add_query_arg('trashed', 1, $sendback); 196 if ( strpos($sendback, 'post.php') !== false ) 197 $sendback = admin_url('edit.php?trashed=1'); 198 else 199 $sendback = add_query_arg('trashed', 1, $sendback); 200 201 201 wp_redirect($sendback); 202 202 exit(); … … 204 204 205 205 case 'untrash': 206 $post_id = (isset($_GET['post']))? intval($_GET['post']) : intval($_POST['post_ID']);206 $post_id = isset($_GET['post']) ? intval($_GET['post']) : intval($_POST['post_ID']); 207 207 check_admin_referer('untrash-post_' . $post_id); 208 208 … … 210 210 211 211 if ( !current_user_can('delete_post', $post_id) ) 212 wp_die( __('You are not allowed to remove this post fromthe trash.') );212 wp_die( __('You are not allowed to move this post out of the trash.') ); 213 213 214 214 if ( ! wp_untrash_post($post_id) ) 215 wp_die( __('Error in re moving from trash...') );215 wp_die( __('Error in restoring from trash...') ); 216 216 217 217 $sendback = wp_get_referer(); 218 if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('edit.php?untrashed=1'); 219 elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); 220 else $sendback = add_query_arg('untrashed', 1, $sendback); 218 if ( strpos($sendback, 'post.php') !== false ) 219 $sendback = admin_url('edit.php?untrashed=1'); 220 else 221 $sendback = add_query_arg('untrashed', 1, $sendback); 222 221 223 wp_redirect($sendback); 222 224 exit(); … … 241 243 242 244 $sendback = wp_get_referer(); 243 if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('edit.php?deleted=1'); 244 elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); 245 else $sendback = add_query_arg('deleted', 1, $sendback); 245 if ( strpos($sendback, 'post.php') !== false ) 246 $sendback = admin_url('edit.php?deleted=1'); 247 else 248 $sendback = add_query_arg('deleted', 1, $sendback); 249 246 250 wp_redirect($sendback); 247 251 exit(); -
trunk/wp-admin/upload.php
r11749 r11807 12 12 wp_enqueue_script( 'jquery-ui-draggable' ); 13 13 14 if ( !current_user_can('upload_files'))14 if ( !current_user_can('upload_files') ) 15 15 wp_die(__('You do not have permission to upload files.')); 16 16 17 if ( isset($_GET['find_detached'] 17 if ( isset($_GET['find_detached']) ) { 18 18 check_admin_referer('bulk-media'); 19 19 20 if ( ! 20 if ( !current_user_can('edit_posts') ) 21 21 wp_die( __('You are not allowed to scan for lost attachments.') ); 22 22 … … 100 100 foreach( (array) $post_ids as $post_id ) { 101 101 if ( !current_user_can('delete_post', $post_id) ) 102 wp_die( __('You are not allowed to remove this post fromthe trash.') );102 wp_die( __('You are not allowed to move this post out of the trash.') ); 103 103 104 104 if ( !wp_untrash_post($post_id) )
Note: See TracChangeset
for help on using the changeset viewer.