WC_Settings_API::update_option
Update a single option.
Метод класса: WC_Settings_API{}
Хуки из метода
Возвращает
true|false. was anything saved?
Использование
$WC_Settings_API = new WC_Settings_API(); $WC_Settings_API->update_option( $key, $value );
- $key(строка) (обязательный)
- Option key.
- $value(разное)
- Value to set.
По умолчанию:''
Список изменений
| С версии 3.4.0 | Введена. |
Код WC_Settings_API::update_option() WC Settings API::update option WC 10.7.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' );
}