Skip to content

Commit 40a936e

Browse files
Copilotswissspidy
andcommitted
Remove unnecessary condition and inline comments
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent 54f9478 commit 40a936e

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

src/Plugin_Command.php

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -240,20 +240,11 @@ 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.
245-
$mu_plugins = get_mu_plugins();
246-
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.
249-
$mu_plugins_subfolder = get_plugins( '/../' . basename( WPMU_PLUGIN_DIR ) );
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).
253-
foreach ( $mu_plugins_subfolder as $file => $plugin_data ) {
254-
if ( ! isset( $mu_plugins[ $file ] ) ) {
255-
$mu_plugins[ $file ] = $plugin_data;
256-
}
243+
$mu_plugins = get_mu_plugins();
244+
$mu_plugins_subfolder = get_plugins( '/../' . basename( WPMU_PLUGIN_DIR ) );
245+
foreach ( $mu_plugins_subfolder as $file => $plugin_data ) {
246+
if ( ! isset( $mu_plugins[ $file ] ) ) {
247+
$mu_plugins[ $file ] = $plugin_data;
257248
}
258249
}
259250

0 commit comments

Comments
 (0)