Changeset 47122 for trunk/src/wp-admin/plugins.php
- Timestamp:
- 01/29/2020 12:43:23 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/plugins.php
r47093 r47122 64 64 65 65 if ( isset( $_GET['from'] ) && 'import' == $_GET['from'] ) { 66 wp_redirect( self_admin_url( 'import.php?import=' . str_replace( '-importer', '', dirname( $plugin ) ) ) ); // overrides the ?error=true one above and redirects to the Imports page, stripping the -importer suffix 66 // Overrides the ?error=true one above and redirects to the Imports page, stripping the -importer suffix. 67 wp_redirect( self_admin_url( 'import.php?import=' . str_replace( '-importer', '', dirname( $plugin ) ) ) ); 67 68 } elseif ( isset( $_GET['from'] ) && 'press-this' == $_GET['from'] ) { 68 69 wp_redirect( self_admin_url( 'press-this.php' ) ); 69 70 } else { 70 wp_redirect( self_admin_url( "plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s" ) ); // overrides the ?error=true one above 71 // Overrides the ?error=true one above. 72 wp_redirect( self_admin_url( "plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s" ) ); 71 73 } 72 74 exit; … … 171 173 } 172 174 173 ini_set( 'display_errors', true ); // Ensure that Fatal errors are displayed.174 // Go back to "sandbox" scope so we get the same errors as before 175 ini_set( 'display_errors', true ); // Ensure that fatal errors are displayed. 176 // Go back to "sandbox" scope so we get the same errors as before. 175 177 plugin_sandbox_scrape( $plugin ); 176 178 /** This action is documented in wp-admin/includes/plugin.php */ … … 255 257 check_admin_referer( 'bulk-plugins' ); 256 258 257 // $_POST = from the plugin form; $_GET = from the FTP details screen.259 // $_POST = from the plugin form; $_GET = from the FTP details screen. 258 260 $plugins = isset( $_REQUEST['checked'] ) ? (array) wp_unslash( $_REQUEST['checked'] ) : array(); 259 261 if ( empty( $plugins ) ) { … … 262 264 } 263 265 264 $plugins = array_filter( $plugins, 'is_plugin_inactive' ); // Do not allow to delete Activated plugins.266 $plugins = array_filter( $plugins, 'is_plugin_inactive' ); // Do not allow to delete activated plugins. 265 267 if ( empty( $plugins ) ) { 266 268 wp_redirect( self_admin_url( "plugins.php?error=true&main=true&plugin_status=$status&paged=$page&s=$s" ) ); … … 269 271 270 272 // Bail on all if any paths are invalid. 271 // validate_file() returns truthy for invalid files 273 // validate_file() returns truthy for invalid files. 272 274 $invalid_plugin_files = array_filter( $plugins, 'validate_file' ); 273 275 if ( $invalid_plugin_files ) { … … 376 378 } else { 377 379 $plugins_to_delete = count( $plugins ); 378 } // endif verify-delete380 } // End if verify-delete. 379 381 380 382 $delete_result = delete_plugins( $plugins ); 381 383 382 set_transient( 'plugins_delete_result_' . $user_ID, $delete_result ); //Store the result in a cache rather than a URL param due to object type & length 384 // Store the result in a cache rather than a URL param due to object type & length. 385 set_transient( 'plugins_delete_result_' . $user_ID, $delete_result ); 383 386 wp_redirect( self_admin_url( "plugins.php?deleted=$plugins_to_delete&plugin_status=$status&paged=$page&s=$s" ) ); 384 387 exit; … … 421 424 422 425 /** This action is documented in wp-admin/edit.php */ 423 $sendback = apply_filters( "handle_bulk_actions-{$screen}", $sendback, $action, $plugins ); 426 $sendback = apply_filters( "handle_bulk_actions-{$screen}", $sendback, $action, $plugins ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores 424 427 wp_safe_redirect( $sendback ); 425 428 exit;
Note: See TracChangeset
for help on using the changeset viewer.