Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Commit f03e071

Browse files
committed
fix update config for multisite
1 parent 7cb95ca commit f03e071

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

core/class-wpm-config.php

+11-16
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@ static public function load_config_run() {
3636
static public function load_plugins_config() {
3737
self::$config_files[] = dirname( WPM_PLUGIN_FILE ) . '/core-config.json';
3838

39-
$plugins = get_option( 'active_plugins' );
40-
if ( ! empty( $plugins ) ) {
41-
foreach ( $plugins as $p ) {
42-
$plugin_slug = dirname( $p );
39+
foreach ( get_plugins() as $pf => $pd ) {
40+
if ( is_plugin_active( $pf ) ) {
41+
$plugin_slug = dirname( $pf );
4342
self::$active_plugins[] = $plugin_slug;
4443
$config_file = WP_PLUGIN_DIR . '/' . $plugin_slug . '/wpm-config.json';
4544
if ( trim( $plugin_slug, '\/.' ) && file_exists( $config_file ) ) {
@@ -48,18 +47,14 @@ static public function load_plugins_config() {
4847
}
4948
}
5049

51-
$mu_plugins = wp_get_mu_plugins();
52-
53-
if ( ! empty( $mu_plugins ) ) {
54-
foreach ( $mu_plugins as $mup ) {
55-
$plugin_dir_name = dirname( $mup );
56-
$plugin_base_name = basename( $mup, '.php' );
57-
self::$active_plugins[] = $plugin_base_name;
58-
$plugin_sub_dir = $plugin_dir_name . '/' . $plugin_base_name;
59-
if ( file_exists( $plugin_sub_dir . '/wpm-config.json' ) ) {
60-
$config_file = $plugin_sub_dir . '/wpm-config.json';
61-
self::$config_files[ $plugin_base_name ] = $config_file;
62-
}
50+
foreach ( wp_get_mu_plugins() as $mup ) {
51+
$plugin_dir_name = dirname( $mup );
52+
$plugin_base_name = basename( $mup, '.php' );
53+
self::$active_plugins[] = $plugin_base_name;
54+
$plugin_sub_dir = $plugin_dir_name . '/' . $plugin_base_name;
55+
if ( file_exists( $plugin_sub_dir . '/wpm-config.json' ) ) {
56+
$config_file = $plugin_sub_dir . '/wpm-config.json';
57+
self::$config_files[ $plugin_base_name ] = $config_file;
6358
}
6459
}
6560
}

0 commit comments

Comments
 (0)