Do not register webhooks during credentials change handling

they will be registered later in the connection page handler
This commit is contained in:
Alex P 2023-03-10 14:50:21 +02:00
parent 36cffad369
commit 26d64139b9
No known key found for this signature in database
GPG key ID: 54487A734A204D71

View file

@ -322,19 +322,6 @@ class SettingsListener {
}
$this->settings->persist();
if ( $credentials_change_status ) {
if ( in_array(
$credentials_change_status,
array( self::CREDENTIALS_ADDED, self::CREDENTIALS_CHANGED ),
true
) ) {
wp_schedule_single_event(
time() + 5,
WebhookRegistrar::EVENT_HOOK
);
}
}
if ( $this->cache->has( PayPalBearer::CACHE_KEY ) ) {
$this->cache->delete( PayPalBearer::CACHE_KEY );
}