WC_Settings_API::update_option( string $key, mixed $value = '' )
Update a single option.
Description Description
Parameters Parameters
- $key
-
(Required) Option key.
- $value
-
(Optional) Value to set.
Default value: ''
Return Return
(bool) was anything saved?
Source Source
File: includes/abstracts/abstract-wc-settings-api.php
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' ); }
Changelog Changelog
Version | Description |
---|---|
3.4.0 | Introduced. |