Skip to content

Commit

Permalink
Connection: fix the connected plugins option on multisites (#39355)
Browse files Browse the repository at this point in the history
Recent optimizations of the connected plugin options update/sync exposed an issue in the original implementation, making the "active connected plugins" option always empty on multisites.
Here we fix that problem.
  • Loading branch information
sergeymitr authored Sep 11, 2024
1 parent 5ee714f commit 11ebad6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fix the connected plugins option on multisites.
5 changes: 4 additions & 1 deletion projects/packages/connection/src/class-plugin-storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ private static function ensure_configured() {
}

if ( is_multisite() && get_current_blog_id() !== self::$current_blog_id ) {
self::$plugins = (array) get_option( self::ACTIVE_PLUGINS_OPTION_NAME, array() );
if ( self::$current_blog_id ) {
// If blog ID got changed, pull the list of active plugins for that blog from the database.
self::$plugins = (array) get_option( self::ACTIVE_PLUGINS_OPTION_NAME, array() );
}
self::$current_blog_id = get_current_blog_id();
}

Expand Down

0 comments on commit 11ebad6

Please sign in to comment.