File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -240,12 +240,17 @@ protected function get_all_items() {
240240 $ items = $ this ->get_item_list ();
241241
242242 // Get all mu-plugins including those in subfolders.
243+ // get_mu_plugins() only returns PHP files directly in the mu-plugins directory.
244+ // To also get plugins in subfolders, we use get_plugins() with a relative path.
243245 $ mu_plugins = get_mu_plugins ();
244246 if ( defined ( 'WPMU_PLUGIN_DIR ' ) ) {
247+ // Get plugins from mu-plugins subfolders using the relative path approach.
248+ // This is the standard WordPress method to access plugins in the mu-plugins directory.
245249 $ mu_plugins_subfolder = get_plugins ( '/../ ' . basename ( WPMU_PLUGIN_DIR ) );
246- // Merge subfolder plugins with the main mu-plugins list.
250+ // Merge subfolder plugins with root-level mu-plugins.
251+ // No duplicates possible: get_mu_plugins() returns 'plugin.php' (root only)
252+ // while get_plugins() returns 'subfolder/plugin.php' (different keys).
247253 foreach ( $ mu_plugins_subfolder as $ file => $ plugin_data ) {
248- // Only add if not already in the list (avoid duplicates from root-level plugins).
249254 if ( ! isset ( $ mu_plugins [ $ file ] ) ) {
250255 $ mu_plugins [ $ file ] = $ plugin_data ;
251256 }
You can’t perform that action at this time.
0 commit comments