WC_Helper_Options::update()
Update an option by key
All helper options are grouped in a single options entry. This method is not thread-safe, use with caution.
Method of the class: WC_Helper_Options{}
No Hooks.
Return
true|false
. True if the option has been updated.
Usage
$result = WC_Helper_Options::update( $key, $value );
- $key(string) (required)
- The key to update.
- $value(mixed) (required)
- The new option value.
WC_Helper_Options::update() WC Helper Options::update code WC 9.8.2
public static function update( $key, $value ) { $options = get_option( self::$option_name, array() ); $options[ $key ] = $value; return update_option( self::$option_name, $options, true ); }