WC_Helper_Options::get()public staticWC 1.0

Get an option by key

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

WC_Helper_Options::get() code WC 8.7.0

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

	return $default;
}