Skip to content

Commit

Permalink
Directly reference plugin array copy
Browse files Browse the repository at this point in the history
  • Loading branch information
jeawhanlee committed Oct 25, 2024
1 parent 05363d6 commit 9e30348
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Model/PluginFamily.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,18 @@ public function filter_plugins_by_activation( array $plugins, string $main_plugi
$active_plugins[ $plugin ] = $plugins[ $cat ]['plugins'][ $plugin ];

// Remove active plugin from current category.
unset( $cat_data['plugins'][ $plugin ] );
$active_plugin = $plugins[ $cat ]['plugins'][ $plugin ];
unset( $plugins[ $cat ]['plugins'][ $plugin ] );

// Send active plugin to the end of array in current category.
$cat_data['plugins'][ $plugin ] = $plugins[ $cat ]['plugins'][ $plugin ];
$plugins[ $cat ]['plugins'][ $plugin ] = $active_plugin;

// Remove category with active plugin from current array.
$active_cat = $plugins[ $cat ];
unset( $plugins[ $cat ] );

// Send category with active plugins to the end of array.
$plugins[ $cat ] = $cat_data;
$plugins[ $cat ] = $active_cat;
continue;
}

Expand Down

0 comments on commit 9e30348

Please sign in to comment.