Ticket #18503: 18503.patch
| File 18503.patch, 2.8 KB (added by SergeyBiryukov, 21 months ago) |
|---|
-
wp-admin/includes/class-wp-plugins-list-table.php
10 10 class WP_Plugins_List_Table extends WP_List_Table { 11 11 12 12 function __construct() { 13 global $status, $page ;13 global $status, $page, $checked_plugins; 14 14 15 15 $default_status = get_user_option( 'plugins_last_view' ); 16 16 if ( empty( $default_status ) ) … … 21 21 if ( $status != $default_status && 'search' != $status ) 22 22 update_user_meta( get_current_user_id(), 'plugins_last_view', $status ); 23 23 24 $checked_plugins = isset( $_REQUEST['plugins'] ) ? $_REQUEST['plugins'] : array(); 25 if ( !empty( $checked_plugins ) ) 26 $checked_plugins = explode( ',', $checked_plugins ); 24 27 25 28 if ( isset($_REQUEST['s']) ) 26 29 $_SERVER['REQUEST_URI'] = add_query_arg('s', stripslashes($_REQUEST['s']) ); … … 318 321 } 319 322 320 323 function single_row( $plugin_file, $plugin_data ) { 321 global $status, $page, $s ;324 global $status, $page, $s, $checked_plugins; 322 325 323 326 $context = $status; 324 327 … … 393 396 394 397 $class = $is_active ? 'active' : 'inactive'; 395 398 $checkbox_id = "checkbox_" . md5($plugin_data['Name']); 396 $checkbox = in_array( $status, array( 'mustuse', 'dropins' ) ) ? '' : "<input type='checkbox' name='checked[]' value='" . esc_attr( $plugin_file ) . "' id='" . $checkbox_id . "' /><label class='screen-reader-text' for='" . $checkbox_id . "' >" . __('Select') . " " . $plugin_data['Name'] . "</label>";399 $checkbox = in_array( $status, array( 'mustuse', 'dropins' ) ) ? '' : "<input type='checkbox' name='checked[]'" . checked( in_array( $plugin_file, $checked_plugins ), true, false ) . " value='" . esc_attr( $plugin_file ) . "' id='" . $checkbox_id . "' /><label class='screen-reader-text' for='" . $checkbox_id . "' >" . __('Select') . " " . $plugin_data['Name'] . "</label>"; 397 400 if ( 'dropins' != $context ) { 398 401 $description = '<p>' . ( $plugin_data['Description'] ? $plugin_data['Description'] : ' ' ) . '</p>'; 399 402 $plugin_name = $plugin_data['Name']; -
wp-admin/plugins.php
200 200 201 201 $plugins = array_filter($plugins, 'is_plugin_inactive'); // Do not allow to delete Activated plugins. 202 202 if ( empty( $plugins ) ) { 203 wp_redirect( self_admin_url( "plugins.php?error=true&main=true&plugin_status=$status&paged=$page&s=$s" ) ); 203 $checked_plugins = implode( ',', $_REQUEST['checked'] ); 204 wp_redirect( self_admin_url( "plugins.php?error=true&main=true&plugin_status=$status&paged=$page&s=$s&plugins=$checked_plugins" ) ); 204 205 exit; 205 206 } 206 207
