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: ''


Top ↑

Return Return

(bool) was anything saved?


Top ↑

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' );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.4.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.