Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/wp-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,9 @@

// Load must-use plugins.
foreach ( wp_get_mu_plugins() as $mu_plugin ) {
$_wp_plugin_file = $mu_plugin;
include_once $mu_plugin;
$mu_plugin = $_wp_plugin_file; // Avoid stomping of the $mu_plugin variable in a plugin.

/**
* Fires once a single must-use plugin has loaded.
Expand All @@ -357,13 +359,16 @@
*/
do_action( 'mu_plugin_loaded', $mu_plugin );
}
unset( $mu_plugin );
unset( $mu_plugin, $_wp_plugin_file );

// Load network activated plugins.
if ( is_multisite() ) {
foreach ( wp_get_active_network_plugins() as $network_plugin ) {
wp_register_plugin_realpath( $network_plugin );

$_wp_plugin_file = $network_plugin;
include_once $network_plugin;
$network_plugin = $_wp_plugin_file; // Avoid stomping of the $network_plugin variable in a plugin.

/**
* Fires once a single network-activated plugin has loaded.
Expand All @@ -374,7 +379,7 @@
*/
do_action( 'network_plugin_loaded', $network_plugin );
}
unset( $network_plugin );
unset( $network_plugin, $_wp_plugin_file );
}

/**
Expand Down Expand Up @@ -415,7 +420,10 @@
// Load active plugins.
foreach ( wp_get_active_and_valid_plugins() as $plugin ) {
wp_register_plugin_realpath( $plugin );

$_wp_plugin_file = $plugin;
include_once $plugin;
$plugin = $_wp_plugin_file; // Avoid stomping of the $plugin variable in a plugin.

/**
* Fires once a single activated plugin has loaded.
Expand All @@ -426,7 +434,7 @@
*/
do_action( 'plugin_loaded', $plugin );
}
unset( $plugin );
unset( $plugin, $_wp_plugin_file );

// Load pluggable functions.
require ABSPATH . WPINC . '/pluggable.php';
Expand Down