Skip to content
Open
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
19 changes: 15 additions & 4 deletions src/wp-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,9 @@
*/
$GLOBALS['wp_plugin_paths'] = array();

// To make get_plugin_data() available for both network-activated and site-activated plugins, see #62244 and #64249.
require_once ABSPATH . 'wp-admin/includes/plugin.php';

// Load must-use plugins.
foreach ( wp_get_mu_plugins() as $mu_plugin ) {
$_wp_plugin_file = $mu_plugin;
Expand All @@ -520,6 +523,17 @@
foreach ( wp_get_active_network_plugins() as $network_plugin ) {
wp_register_plugin_realpath( $network_plugin );

$plugin_data = get_plugin_data( $network_plugin, false, false );

$textdomain = $plugin_data['TextDomain'];
if ( $textdomain ) {
if ( $plugin_data['DomainPath'] ) {
$GLOBALS['wp_textdomain_registry']->set_custom_path( $textdomain, dirname( $network_plugin ) . $plugin_data['DomainPath'] );
} else {
$GLOBALS['wp_textdomain_registry']->set_custom_path( $textdomain, dirname( $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.
Expand All @@ -533,7 +547,7 @@
*/
do_action( 'network_plugin_loaded', $network_plugin );
}
unset( $network_plugin, $_wp_plugin_file );
unset( $network_plugin, $_wp_plugin_file, $plugin_data, $textdomain );
}

/**
Expand Down Expand Up @@ -571,9 +585,6 @@
wp_recovery_mode()->initialize();
}

// To make get_plugin_data() available in a way that's compatible with plugins also loading this file, see #62244.
require_once ABSPATH . 'wp-admin/includes/plugin.php';

// Load active plugins.
foreach ( wp_get_active_and_valid_plugins() as $plugin ) {
wp_register_plugin_realpath( $plugin );
Expand Down
Loading