Changeset 9028 for trunk/wp-admin/edit-pages.php
- Timestamp:
- 09/29/2008 09:26:21 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-pages.php
r9018 r9028 11 11 12 12 // Handle bulk actions 13 if ( isset($_GET['action']) && $_GET['action'] != -1 ) { 14 switch ( $_GET['action'] ) { 13 if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) { 14 $doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2']; 15 16 switch ( $doaction ) { 15 17 case 'delete': 16 18 if ( isset($_GET['post']) && isset($_GET['doaction']) ) { … … 18 20 foreach( (array) $_GET['post'] as $post_id_del ) { 19 21 $post_del = & get_post($post_id_del); 20 22 21 23 if ( !current_user_can('delete_page', $post_id_del) ) 22 24 wp_die( __('You are not allowed to delete this page.') ); 23 25 24 26 if ( $post_del->post_type == 'attachment' ) { 25 27 if ( ! wp_delete_attachment($post_id_del) ) … … 36 38 check_admin_referer('bulk-pages'); 37 39 $_GET['post_status'] = $_GET['_status']; 38 40 39 41 if ( -1 == $_GET['post_author'] ) 40 42 unset($_GET['post_author']); 41 43 42 44 $done = bulk_edit_posts($_GET); 43 45 } … … 56 58 wp_redirect($sendback); 57 59 exit(); 58 } elseif ( !empty($_GET['_wp_http_referer']) ) {59 wp_redirect( remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));60 } elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) { 61 wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) ); 60 62 exit; 61 63 } … … 108 110 </div></div> 109 111 110 <?php if ( isset($_GET['upd']) && (int) $_GET['upd'] ) { ?> 112 <div class="wrap"> 113 114 <?php if ( isset($_GET['upd']) || isset($_GET['skip']) ) { ?> 111 115 <div id="message" class="updated fade"><p> 112 <?php printf( __ngettext( '%d page updated.', '%d pages updated.', $_GET['upd'] ), number_format_i18n( $_GET['upd'] ) ); 113 unset($_GET['upd']); 114 115 if ( isset($_GET['skip']) && (int) $_GET['skip'] ) { 116 printf( __ngettext( ' %d page not updated. Somebody is editing it.', ' %d pages not updated. Somebody is editing them.', $_GET['skip'] ), number_format_i18n( $_GET['skip'] ) ); 117 unset($_GET['skip']); 118 } ?> 116 <?php if ( (int) $_GET['upd'] ) { 117 printf( __ngettext( '%d page updated.', '%d pages updated.', $_GET['upd'] ), number_format_i18n( $_GET['upd'] ) ); 118 unset($_GET['upd']); 119 } 120 121 if ( (int) $_GET['skip'] ) { 122 printf( __ngettext( ' %d page not updated. Somebody is editing it.', ' %d pages not updated. Somebody is editing them.', $_GET['skip'] ), number_format_i18n( $_GET['skip'] ) ); 123 unset($_GET['skip']); 124 } ?> 119 125 </p></div> 120 126 <?php } ?> 121 127 122 <div class="wrap"> 128 <?php if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?> 129 <div id="message" class="updated fade"><p><strong><?php _e('Your page has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View page'); ?></a> | <a href="<?php echo get_edit_post_link( $_GET['posted'] ); ?>"><?php _e('Edit page'); ?></a></p></div> 130 <?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']); 131 endif; ?> 123 132 124 133 <h2><?php … … 159 168 </ul> 160 169 170 <form id="posts-filter" action="" method="get"> 171 161 172 <?php if ( isset($_GET['post_status'] ) ) : ?> 162 173 <input type="hidden" name="post_status" value="<?php echo attribute_escape($_GET['post_status']) ?>" /> 163 <?php endif; 164 165 if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?> 166 <div id="message" class="updated fade"><p><strong><?php _e('Your page has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View page'); ?></a> | <a href="<?php echo get_edit_post_link( $_GET['posted'] ); ?>"><?php _e('Edit page'); ?></a></p></div> 167 <?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']); 168 endif; 169 ?> 174 <?php endif; ?> 170 175 171 176 <div class="tablenav"> … … 190 195 ?> 191 196 192 <form id="posts-filter" action="" method="get">193 194 197 <div class="alignleft"> 195 198 <select name="action"> 196 <option value="-1" selected ><?php _e('Actions'); ?></option>199 <option value="-1" selected="selected"><?php _e('Actions'); ?></option> 197 200 <option value="edit"><?php _e('Edit'); ?></option> 198 201 <option value="delete"><?php _e('Delete'); ?></option> … … 219 222 </tr> 220 223 </thead> 224 225 <tfoot> 226 <tr> 227 <?php print_column_headers('page', false); ?> 228 </tr> 229 </tfoot> 230 221 231 <tbody> 222 232 <?php page_rows($posts, $pagenum, $per_page); ?> 223 233 </tbody> 224 234 </table> 235 236 <div class="tablenav"> 237 <?php 238 if ( $page_links ) 239 echo "<div class='tablenav-pages'>$page_links</div>"; 240 ?> 241 242 <div class="alignleft"> 243 <select name="action2"> 244 <option value="-1" selected="selected"><?php _e('Actions'); ?></option> 245 <option value="edit"><?php _e('Edit'); ?></option> 246 <option value="delete"><?php _e('Delete'); ?></option> 247 </select> 248 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" /> 249 </div> 250 251 <br class="clear" /> 252 </div> 253 225 254 </form> 226 255 … … 238 267 ?> 239 268 240 <div class="tablenav">241 <?php242 if ( $page_links )243 echo "<div class='tablenav-pages'>$page_links</div>";244 ?>245 <br class="clear" />246 </div>247 269 248 270 <?php
Note: See TracChangeset
for help on using the changeset viewer.