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.


Mixed. An option or the default.


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


  • 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;