Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Trigger sync when `auto_update_plugins` option is updated
6 changes: 5 additions & 1 deletion projects/plugins/wpcomsh/feature-plugins/managed-plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,12 @@ function wpcomsh_auto_update_new_plugins_by_default( $pre_auto_update_plugins )
}

if ( is_array( $auto_update_plugins ) && ! empty( $new_unmanaged_plugins ) ) {
$auto_update_plugins = array_unique( array_merge( $auto_update_plugins, $new_unmanaged_plugins ) );
$old_auto_update_plugins = $auto_update_plugins;
$auto_update_plugins = array_unique( array_merge( $auto_update_plugins, $new_unmanaged_plugins ) );
update_option( 'auto_update_plugins', $auto_update_plugins );

// Trigger Jetpack sync for the auto_update_plugins option change.
do_action( 'updated_option', 'auto_update_plugins', $old_auto_update_plugins, $auto_update_plugins );
}

if ( $baseline_plugins_list != $fresh_plugins_list ) { //phpcs:ignore
Expand Down