Automattic\WooCommerce\Internal\Email

EmailStyleSync::maybe_sync_on_option_updatepublicWC 1.0

Trigger sync when auto-sync option is enabled.

Method of the class: EmailStyleSync{}

No Hooks.

Returns

null. Nothing (null).

Usage

$EmailStyleSync = new EmailStyleSync();
$EmailStyleSync->maybe_sync_on_option_update( $old_value, $new_value, $option );
$old_value(mixed) (required)
The old option value.
$new_value(mixed) (required)
The new option value.
$option(string) (required)
The option name.

EmailStyleSync::maybe_sync_on_option_update() code WC 9.8.5

public function maybe_sync_on_option_update( $old_value, $new_value, $option ) {
	if ( 'yes' === $new_value && 'yes' !== $old_value ) {
		// Force sync regardless of current auto-sync setting since we know it's being enabled.
		$this->is_syncing = true;
		try {
			$this->update_email_colors();
		} finally {
			$this->is_syncing = false;
		}
	}
}