Skip to content

Commit

Permalink
Sync: Sync the network update event everytime (#8469)
Browse files Browse the repository at this point in the history
Use the pre_update_site option filter to hook into the event. This way we would always get the event not just when the is really necessary and the option gets updated.
  • Loading branch information
enejb authored Jan 9, 2018
1 parent 45d67f1 commit d247331
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sync/class.jetpack-sync-module-updates.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function init_listeners( $callable ) {


if ( is_multisite() ) {
add_action( 'update_site_option_wpmu_upgrade_site', array ( $this, 'update_core_network_event' ), 10, 3 );
add_filter( 'pre_update_site_option_wpmu_upgrade_site', array ( $this, 'update_core_network_event' ), 10, 2 );
add_action( 'jetpack_sync_core_update_network', $callable, 10, 3 );
}

Expand All @@ -55,7 +55,7 @@ public function init_before_send() {
add_filter( 'jetpack_sync_before_send_jetpack_update_themes_change', array( $this, 'expand_themes' ) );
}

public function update_core_network_event( $option, $wp_db_version, $old_wp_db_version ) {
public function update_core_network_event( $wp_db_version, $old_wp_db_version ) {
global $wp_version;
/**
* Sync event for when core wp network updates to a new db version
Expand All @@ -68,6 +68,7 @@ public function update_core_network_event( $option, $wp_db_version, $old_wp_db_v
*
*/
do_action( 'jetpack_sync_core_update_network', $wp_db_version, $old_wp_db_version, $wp_version );
return $wp_db_version;
}

public function update_core( $new_wp_version ) {
Expand Down

0 comments on commit d247331

Please sign in to comment.