Fix return value

This commit is contained in:
Alex P 2021-08-27 13:46:54 +03:00
parent 45bef752fd
commit 3ebd3b29bd

View file

@ -395,14 +395,18 @@ class PayPalGateway extends \WC_Payment_Gateway {
*
* @param string $key The option key.
* @param string $value The option value.
* @return bool|void
* @return bool was anything saved?
*/
public function update_option( $key, $value = '' ) {
parent::update_option( $key, $value );
$ret = parent::update_option( $key, $value );
if ( 'enabled' === $key ) {
$this->config->set( 'enabled', 'yes' === $value );
$this->config->persist();
}
return true;
}
return $ret;
}
}