Ticket #16166: 16166.2.diff
File 16166.2.diff, 9.4 KB (added by , 14 years ago) |
---|
-
wp-admin/users.php
49 49 check_admin_referer('bulk-users'); 50 50 51 51 if ( empty($_REQUEST['users']) ) { 52 wp_redirect($redirect);52 $wp_list_table->redirect( $redirect ); 53 53 exit(); 54 54 } 55 55 … … 78 78 $user->set_role($_REQUEST['new_role']); 79 79 } 80 80 81 wp_redirect(add_query_arg('update', $update, $redirect));81 $wp_list_table->redirect(add_query_arg('update', $update, $redirect)); 82 82 exit(); 83 83 84 84 break; … … 137 137 check_admin_referer('bulk-users'); 138 138 139 139 if ( empty($_REQUEST['users']) && empty($_REQUEST['user']) ) { 140 wp_redirect($redirect);140 $wp_list_table->redirect($redirect); 141 141 exit(); 142 142 } 143 143 … … 232 232 check_admin_referer('bulk-users'); 233 233 234 234 if ( empty($_REQUEST['users']) && empty($_REQUEST['user']) ) { 235 wp_redirect($redirect);235 $wp_list_table->redirect($redirect); 236 236 exit(); 237 237 } 238 238 -
wp-admin/edit-comments.php
37 37 $approved = $unapproved = $spammed = $unspammed = $trashed = $untrashed = $deleted = 0; 38 38 39 39 $redirect_to = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'spammed', 'unspammed', 'approved', 'unapproved', 'ids' ), wp_get_referer() ); 40 $redirect_to = $wp_list_table->add_query_args( $redirect_to );41 40 42 41 foreach ( $comment_ids as $comment_id ) { // Check the permissions on each 43 42 if ( !current_user_can( 'edit_comment', $comment_id ) ) … … 92 91 if ( $trashed || $spammed ) 93 92 $redirect_to = add_query_arg( 'ids', join( ',', $comment_ids ), $redirect_to ); 94 93 95 wp_redirect( $redirect_to );94 $wp_list_table->redirect( $redirect_to ); 96 95 exit; 97 96 } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) { 98 97 wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) ); -
wp-admin/includes/class-wp-list-table.php
631 631 632 632 return array( $current_orderby, $current_order ); 633 633 } 634 635 function add_query_args( $location ) {634 635 function redirect( $location ) { 636 636 $pagenum = $this->get_pagenum(); 637 637 list( $current_orderby, $current_order ) = $this->get_order_info(); 638 638 $location = add_query_arg( 'paged', $pagenum, $location ); 639 639 if ( $current_orderby ) 640 640 $location = add_query_arg( array( 'orderby' => $current_orderby, 'order' => $current_order ), $location ); 641 642 return $location; 641 wp_redirect( $location ); 643 642 } 644 643 645 644 /** -
wp-admin/edit-tags.php
78 78 79 79 wp_delete_term( $tag_ID, $taxonomy ); 80 80 81 $location = $wp_list_table->add_query_args( $location );82 81 $location = add_query_arg( 'message', 2, $location ); 83 wp_redirect( $location );82 $wp_list_table->redirect( $location ); 84 83 exit; 85 84 86 85 break; … … 105 104 } 106 105 107 106 $location = add_query_arg( 'message', 6, $location ); 108 $location = $wp_list_table->add_query_args( $location ); 109 wp_redirect( $location ); 107 $wp_list_table->redirect( $location ); 110 108 exit; 111 109 112 110 break; -
wp-admin/upload.php
84 84 $location = $referer; 85 85 } 86 86 87 $location = $wp_list_table->add_query_args( $location );88 87 $location = add_query_arg( array( 'attached' => $attached ) , $location ); 89 wp_redirect( $location );88 $wp_list_table->redirect( $location ); 90 89 exit; 91 90 } 92 91 break; … … 122 121 break; 123 122 } 124 123 125 $location = $wp_list_table->add_query_args( $location ); 126 wp_redirect( $location ); 124 $wp_list_table->redirect( $location ); 127 125 exit; 128 126 } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) { 129 127 wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) ); -
wp-admin/network/edit.php
223 223 } 224 224 } 225 225 226 wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => $blogfunction ), wp_get_referer() ) );226 $wp_list_table->redirect( add_query_arg( array( 'updated' => 'true', 'action' => $blogfunction ), wp_get_referer() ) ); 227 227 } else { 228 wp_redirect( network_admin_url( 'sites.php' ) );228 $wp_list_table->redirect( network_admin_url( 'sites.php' ) ); 229 229 } 230 230 exit(); 231 231 break; … … 425 425 } 426 426 } 427 427 428 wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => $userfunction ), wp_get_referer() ) );428 $wp_list_table->redirect( add_query_arg( array( 'updated' => 'true', 'action' => $userfunction ), wp_get_referer() ) ); 429 429 } else { 430 wp_redirect( network_admin_url( 'users.php' ) );430 $wp_list_table->redirect( network_admin_url( 'users.php' ) ); 431 431 } 432 432 exit(); 433 433 break; -
wp-admin/network/themes.php
40 40 check_admin_referer('enable-theme_' . $_GET['theme']); 41 41 $allowed_themes[ $_GET['theme'] ] = true; 42 42 update_site_option( 'allowedthemes', $allowed_themes ); 43 wp_redirect( add_query_arg( 'enabled', '1', $referer ) );43 $wp_list_table->redirect( add_query_arg( 'enabled', '1', $referer ) ); 44 44 exit; 45 45 break; 46 46 case 'disable': 47 47 check_admin_referer('disable-theme_' . $_GET['theme']); 48 48 unset( $allowed_themes[ $_GET['theme'] ] ); 49 49 update_site_option( 'allowedthemes', $allowed_themes ); 50 wp_redirect( add_query_arg( 'disabled', '1', $referer ) );50 $wp_list_table->redirect( add_query_arg( 'disabled', '1', $referer ) ); 51 51 exit; 52 52 break; 53 53 case 'enable-selected': 54 54 check_admin_referer('bulk-themes'); 55 55 $themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); 56 56 if ( empty($themes) ) { 57 wp_redirect( add_query_arg( 'error', 'none', $referer ) );57 $wp_list_table->redirect( add_query_arg( 'error', 'none', $referer ) ); 58 58 exit; 59 59 } 60 60 foreach( (array) $themes as $theme ) 61 61 $allowed_themes[ $theme ] = true; 62 62 update_site_option( 'allowedthemes', $allowed_themes ); 63 wp_redirect( add_query_arg( 'enabled', count( $themes ), $referer ) );63 $wp_list_table->redirect( add_query_arg( 'enabled', count( $themes ), $referer ) ); 64 64 exit; 65 65 break; 66 66 case 'disable-selected': 67 67 check_admin_referer('bulk-themes'); 68 68 $themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); 69 69 if ( empty($themes) ) { 70 wp_redirect( add_query_arg( 'error', 'none', $referer ) );70 $wp_list_table->redirect( add_query_arg( 'error', 'none', $referer ) ); 71 71 exit; 72 72 } 73 73 foreach( (array) $themes as $theme ) 74 74 unset( $allowed_themes[ $theme ] ); 75 75 update_site_option( 'allowedthemes', $allowed_themes ); 76 wp_redirect( add_query_arg( 'disabled', count( $themes ), $referer ) );76 $wp_list_table->redirect( add_query_arg( 'disabled', count( $themes ), $referer ) ); 77 77 exit; 78 78 break; 79 79 case 'delete-selected': … … 89 89 unset( $themes[ get_option( 'stylesheet' ) ] ); 90 90 91 91 if ( empty( $themes ) ) { 92 wp_redirect( add_query_arg( 'error', 'none', $referer ) );92 $wp_list_table->redirect( add_query_arg( 'error', 'none', $referer ) ); 93 93 exit; 94 94 } 95 95 … … 104 104 $theme_info[ $theme ] = $data; 105 105 } 106 106 } 107 107 108 108 if ( empty( $themes ) ) { 109 wp_redirect( add_query_arg( 'error', 'main', $referer ) );109 $wp_list_table->redirect( add_query_arg( 'error', 'main', $referer ) ); 110 110 exit; 111 111 } 112 112 -
wp-admin/edit.php
41 41 check_admin_referer('bulk-posts'); 42 42 43 43 $sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer() ); 44 $sendback = $wp_list_table->add_query_args( $sendback );45 44 if ( strpos($sendback, 'post.php') !== false ) 46 45 $sendback = admin_url($post_new_file); 47 46 … … 123 122 124 123 $sendback = remove_query_arg( array('action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view'), $sendback ); 125 124 126 wp_redirect($sendback);125 $wp_list_table->redirect( $sendback ); 127 126 exit(); 128 127 } elseif ( ! empty($_REQUEST['_wp_http_referer']) ) { 129 128 wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) ); -
wp-admin/link-manager.php
27 27 wp_delete_link( $link_id ); 28 28 } 29 29 30 wp_redirect( add_query_arg('deleted', count( $bulklinks ), admin_url( 'link-manager.php' ) ) );30 $wp_list_table->redirect( add_query_arg('deleted', count( $bulklinks ), admin_url( 'link-manager.php' ) ) ); 31 31 exit; 32 32 } 33 33 } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {