remove reset functionality from Settings container

This commit is contained in:
David Remer 2020-09-25 12:01:33 +03:00
parent 074a6ea139
commit e8a3b3d28c
2 changed files with 0 additions and 27 deletions

View file

@ -72,17 +72,6 @@ class Settings implements ContainerInterface {
update_option( self::KEY, $this->settings );
}
/**
* Resets the onboarding.
*
* @return bool
*/
public function reset(): bool {
$this->load();
$this->settings = array();
return true;
}
/**
* Loads the settings.

View file

@ -133,22 +133,6 @@ class SettingsListener {
return;
}
/**
* Nonce verification has been done in is_valid_update_request().
*
* phpcs:disable WordPress.Security.NonceVerification.Missing
* phpcs:disable WordPress.Security.NonceVerification.Recommended
*/
if ( isset( $_POST['save'] ) && sanitize_text_field( wp_unslash( $_POST['save'] ) ) === 'reset' ) {
$this->settings->reset();
$this->settings->persist();
$this->webhook_registrar->unregister();
if ( $this->cache->has( PayPalBearer::CACHE_KEY ) ) {
$this->cache->delete( PayPalBearer::CACHE_KEY );
}
return;
}
/**
* Sanitization is done in retrieve_settings_from_raw_data().
*