WC_Helper_Options::get
Get an option by key
Method of the class: WC_Helper_Options{}
No Hooks.
Returns
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() WC Helper Options::get code WC 11.1.2
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;
}