WordPress at Your Fingertips
function is not described

WC_Settings_API::update_option() public WC 3.4.0

Update a single option.

{} It's a method of the class: WC_Settings_API{}

Return

true|false. was anything saved?

Usage

$WC_Settings_API = new WC_Settings_API();
$WC_Settings_API->update_option( $key, $value );
$key(string) (required)
Option key.
$value(mixed)
Value to set.
Default: ''

Changelog

Since 3.4.0 Introduced.

Code of WC_Settings_API::update_option() WC 5.8.0

public function update_option( $key, $value = '' ) {
	if ( empty( $this->settings ) ) {
		$this->init_settings();
	}

	$this->settings[ $key ] = $value;

	return update_option( $this->get_option_key(), apply_filters( 'woocommerce_settings_api_sanitized_fields_' . $this->id, $this->settings ), 'yes' );
}