Ticket #16031: 16031.4.diff
File 16031.4.diff, 14.7 KB (added by , 8 years ago) |
---|
-
src/wp-admin/edit-comments.php
82 82 } 83 83 } 84 84 85 if ( ! in_array( $doaction, array( 'approve', 'unapprove', 'spam', 'unspam', 'trash', 'delete' ) ) ) { 86 /** 87 * Fires when a custom bulk action should be handled. 88 * 89 * The sendback link should be modified with success or failure feedback 90 * from the action to be used to display feedback to the user. 91 * 92 * @since 4.7.0 93 * 94 * @param string $redirect_to The redirect URL. 95 * @param string $doaction The action being taken. 96 * @param array $comment_ids The comments to take the action on. 97 */ 98 $redirect_to = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $redirect_to, $doaction, $comment_ids ); 99 } 100 85 101 wp_defer_comment_counting( false ); 86 102 87 103 if ( $approved ) -
src/wp-admin/edit-tags.php
195 195 else 196 196 $location = add_query_arg( array( 'error' => true, 'message' => 5 ), $location ); 197 197 break; 198 default: 199 if ( !$wp_list_table->current_action() || ! isset( $_REQUEST['delete_tags']) ) { 200 break; 201 } 202 check_admin_referer( 'bulk-tags' ); 203 $tags = (array) $_REQUEST['delete_tags']; 204 /** 205 * Fires when a custom bulk action should be handled. 206 * 207 * The sendback link should be modified with success or failure feedback 208 * from the action to be used to display feedback to the user. 209 * 210 * @since 4.7.0 211 * 212 * @param string $location The redirect URL. 213 * @param string $action The action being taken. 214 * @param array $tags The tag IDs to take the action on. 215 */ 216 $location = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $location, $wp_list_table->current_action(), $tags ); 217 break; 198 218 } 199 219 200 220 if ( ! $location && ! empty( $_REQUEST['_wp_http_referer'] ) ) { … … 210 230 * Filters the taxonomy redirect destination URL. 211 231 * 212 232 * @since 4.6.0 213 * 233 * 214 234 * @param string $location The destination URL. 215 235 * @param object $tax The taxonomy object. 216 236 */ -
src/wp-admin/edit.php
162 162 } 163 163 } 164 164 break; 165 default: 166 /** 167 * Fires when a custom bulk action should be handled. 168 * 169 * The sendback link should be modified with success or failure feedback 170 * from the action to be used to display feedback to the user. 171 * 172 * @since 4.7.0 173 * 174 * @param string $sendback The redirect URL. 175 * @param string $doaction The action being taken. 176 * @param array $post_ids The post IDs to take the action on. 177 */ 178 $sendback = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $sendback, $doaction, $post_ids ); 179 break; 165 180 } 166 181 167 182 $sendback = remove_query_arg( array('action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view'), $sendback ); -
src/wp-admin/includes/class-wp-list-table.php
436 436 */ 437 437 protected function bulk_actions( $which = '' ) { 438 438 if ( is_null( $this->_actions ) ) { 439 $ no_new_actions = $this->_actions = $this->get_bulk_actions();439 $this->_actions = $this->get_bulk_actions(); 440 440 /** 441 441 * Filters the list table Bulk Actions drop-down. 442 442 * … … 450 450 * @param array $actions An array of the available bulk actions. 451 451 */ 452 452 $this->_actions = apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions ); 453 $this->_actions = array_intersect_assoc( $this->_actions, $no_new_actions );454 453 $two = ''; 455 454 } else { 456 455 $two = '2'; -
src/wp-admin/link-manager.php
19 19 if ( $doaction && isset( $_REQUEST['linkcheck'] ) ) { 20 20 check_admin_referer( 'bulk-bookmarks' ); 21 21 22 $redirect_to = admin_url( 'link-manager.php' ); 23 $bulklinks = (array) $_REQUEST['linkcheck']; 24 22 25 if ( 'delete' == $doaction ) { 23 $bulklinks = (array) $_REQUEST['linkcheck']; 26 24 27 foreach ( $bulklinks as $link_id ) { 25 28 $link_id = (int) $link_id; 26 29 … … 27 30 wp_delete_link( $link_id ); 28 31 } 29 32 30 wp_redirect( add_query_arg('deleted', count( $bulklinks ), admin_url( 'link-manager.php' ) ) ); 31 exit; 33 $redirect_to = add_query_arg( 'deleted', count( $bulklinks ), $redirect_to ); 34 } else { 35 /** 36 * Fires when a custom bulk action should be handled. 37 * 38 * The redirect link should be modified with success or failure feedback 39 * from the action to be used to display feedback to the user. 40 * 41 * @since 4.7.0 42 * 43 * @param string $redirect_to The redirect URL. 44 * @param string $doaction The action being taken. 45 * @param array $bulklinks The links to take the action on. 46 */ 47 $redirect_to = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $redirect_to, $doaction, $bulklinks ); 32 48 } 49 50 wp_redirect( $redirect_to ); 51 exit; 33 52 } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) { 34 53 wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ); 35 54 exit; -
src/wp-admin/network/site-themes.php
122 122 $n = 'none'; 123 123 } 124 124 break; 125 default: 126 if ( isset( $_POST['checked'] ) ) { 127 check_admin_referer( 'bulk-themes' ); 128 $themes = (array) $_POST['checked']; 129 $n = count( $themes ); 130 /** 131 * Fires when a custom bulk action should be handled. 132 * 133 * The sendback link should be modified with success or failure feedback 134 * from the action to be used to display feedback to the user. 135 * 136 * @since 4.7.0 137 * 138 * @param string $referer The redirect URL. 139 * @param string $action The action being taken. 140 * @param array $theme_ids The themes to take the action on. 141 * @param int $site_id The current site id 142 */ 143 $referer = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $referer, $action, $_REQUEST['checked'], $id ); 144 } else { 145 $action = 'error'; 146 $n = 'none'; 147 } 125 148 } 126 149 127 150 update_option( 'allowedthemes', $allowed_themes ); -
src/wp-admin/network/site-users.php
164 164 $update = 'err_promote'; 165 165 } 166 166 break; 167 default: 168 if ( ! isset( $_REQUEST['users'] ) { 169 break; 170 } 171 check_admin_referer( 'bulk-users' ); 172 $userids = $_REQUEST['users']; 173 /** 174 * Fires when a custom bulk action should be handled. 175 * 176 * The sendback link should be modified with success or failure feedback 177 * from the action to be used to display feedback to the user. 178 * 179 * @since 4.7.0 180 * 181 * @param string $referer The redirect URL. 182 * @param string $action The action being taken. 183 * @param array $userids The users to take the action on. 184 * @param int $site_id The id of the current site 185 */ 186 $referer = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $referer, $action, $userids, $id ); 187 $update = $action; 188 break; 167 189 } 168 190 169 191 wp_safe_redirect( add_query_arg( 'update', $update, $referer ) ); -
src/wp-admin/network/sites.php
160 160 wp_die( __( 'Sorry, you are not allowed to change the current site.' ) ); 161 161 } 162 162 } 163 if ( ! in_array( $doaction, array( 'delete', 'spam', 'notspam' ) ) ) { 164 $redirect_to = wp_get_referer(); 165 $blogs = (array) $_POST['allblogs']; 166 /** 167 * Fires when a custom bulk action should be handled. 168 * 169 * The redirect link should be modified with success or failure feedback 170 * from the action to be used to display feedback to the user. 171 * 172 * @since 4.7.0 173 * 174 * @param string $redirect_to The redirect URL. 175 * @param string $action The action being taken. 176 * @param array $blog_ids The blogs to take the action on. 177 * @param int $site_id The current site id. 178 */ 179 $redirect_to = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $redirect_to, $doaction, $blogs, $id ); 180 wp_safe_redirect( $redirect_to ); 181 exit(); 182 } 163 183 } else { 164 184 $location = network_admin_url( 'sites.php' ); 165 185 if ( ! empty( $_REQUEST['paged'] ) ) { -
src/wp-admin/network/themes.php
195 195 's' => $s 196 196 ), network_admin_url( 'themes.php' ) ) ); 197 197 exit; 198 default: 199 $themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); 200 if ( empty( $themes ) ) { 201 wp_safe_redirect( add_query_arg( 'error', 'none', $referer ) ); 202 exit; 203 } 204 check_admin_referer( 'bulk-themes' ); 205 206 /** 207 * Fires when a custom bulk action should be handled. 208 * 209 * The redirect link should be modified with success or failure feedback 210 * from the action to be used to display feedback to the user. 211 * 212 * @since 4.7.0 213 * 214 * @param string $referer The redirect URL. 215 * @param string $action The action being taken. 216 * @param array $theme_ids The themes to take the action on. 217 */ 218 $referer = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $referer, $action, $themes ); 219 220 wp_safe_redirect( $referer ); 221 exit; 198 222 } 223 199 224 } 200 225 201 226 $wp_list_table->prepare_items(); -
src/wp-admin/network/users.php
93 93 } 94 94 } 95 95 96 if ( ! in_array( $doaction, array( 'delete', 'spam', 'notspam' ) ) ) { 97 $sendback = wp_get_referer(); 98 99 $user_ids = (array) $_POST['allusers']; 100 /** 101 * Fires when a custom bulk action should be handled. 102 * 103 * The sendback link should be modified with success or failure feedback 104 * from the action to be used to display feedback to the user. 105 * 106 * @since 4.7.0 107 * 108 * @param string $sendback The redirect URL. 109 * @param string $action The action being taken. 110 * @param array $user_ids The users to take the action on. 111 * @param int $site_id The id of the current site 112 */ 113 $sendback = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $sendback, $doaction, $user_ids, $id ); 114 115 wp_safe_redirect( $sendback ); 116 exit(); 117 } 118 96 119 wp_safe_redirect( add_query_arg( array( 'updated' => 'true', 'action' => $userfunction ), wp_get_referer() ) ); 97 120 } else { 98 121 $location = network_admin_url( 'users.php' ); -
src/wp-admin/plugins.php
356 356 update_site_option( 'recently_activated', array() ); 357 357 } 358 358 break; 359 360 default: 361 if ( isset( $_POST['checked'] ) ) { 362 check_admin_referer('bulk-plugins'); 363 $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); 364 $sendback = wp_get_referer(); 365 366 /** 367 * Fires when a custom bulk action should be handled. 368 * 369 * The sendback link should be modified with success or failure feedback 370 * from the action to be used to display feedback to the user. 371 * 372 * @since 4.7.0 373 * 374 * @param string $sendback The redirect URL. 375 * @param string $action The action being taken. 376 * @param array $plugin_ids The plugins to take the action on. 377 */ 378 $sendback = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $sendback, $action, $_POST['checked'] ); 379 380 wp_safe_redirect( $sendback ); 381 exit; 382 } 383 break; 359 384 } 385 360 386 } 361 387 362 388 $wp_list_table->prepare_items(); -
src/wp-admin/upload.php
163 163 } 164 164 $location = add_query_arg( 'deleted', count( $post_ids ), $location ); 165 165 break; 166 default: 167 /** 168 * Fires when a custom bulk action should be handled. 169 * 170 * The sendback link should be modified with success or failure feedback 171 * from the action to be used to display feedback to the user. 172 * 173 * @since 4.7.0 174 * 175 * @param string $location The redirect URL. 176 * @param string $doaction The action being taken. 177 * @param array $post_ids The posts to take the action on. 178 */ 179 $location = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $location, $doaction, $post_ids ); 166 180 } 167 181 168 182 wp_redirect( $location ); -
src/wp-admin/users.php
410 410 exit; 411 411 } 412 412 413 if ( $wp_list_table->current_action() && ! empty( $_REQUEST['users'] ) ) { 414 $userids = $_REQUEST['users']; 415 $sendback = wp_get_referer(); 416 417 /** 418 * Fires when a custom bulk action should be handled. 419 * 420 * The sendback link should be modified with success or failure feedback 421 * from the action to be used to display feedback to the user. 422 * 423 * @since 4.7.0 424 * 425 * @param string $sendback The redirect URL. 426 * @param string $action The action being taken. 427 * @param array $userids The users to take the action on. 428 */ 429 $sendback = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $sendback, $wp_list_table->current_action(), $userids ); 430 431 wp_safe_redirect( $sendback ); 432 exit; 433 } 434 413 435 $wp_list_table->prepare_items(); 414 436 $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); 415 437 if ( $pagenum > $total_pages && $total_pages > 0 ) {