WC_Helper_Options::get()public staticWC 1.0

Get an option by key

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

No Hooks.

Return

Mixed. An option or the default.

Usage

$result = WC_Helper_Options::get( $key, $default );
$key(string) (required)
The key to fetch.
$default(mixed)
The default option to return if the key does not exist.
Default: false

Notes

  • See: self::update

Code of WC_Helper_Options::get() WC 6.6.1

public static function get( $key, $default = false ) {
	$options = get_option( self::$option_name, array() );
	if ( array_key_exists( $key, $options ) ) {
		return $options[ $key ];
	}

	return $default;
}