wchau_get_option_value
The WooCommerce Hear About Us wchau get option value function.
Description
Parameters (2)
- 0. $option
- The option.
- 1. $empty_value — Optional. (constant) =>
null
- The empty value.
Usage
if ( !function_exists( 'wchau_get_option_value' ) ) { require_once ABSPATH . PLUGINDIR . 'woocommerce-hear-about-us/includes/wchau-functions.php'; } // The option. $option = null; // The empty value. $empty_value = null; // NOTICE! Understand what this does before running. $result = wchau_get_option_value($option, $empty_value);
Defined (1)
The function is defined in the following location(s).
- /includes/wchau-functions.php
- function wchau_get_option_value($option, $empty_value = null) {
- $options = WCHAU_Custom_Field::get_options();
- if ( empty( $option ) ) {
- return !isset($empty_value) ? __( 'N/A', 'woocommerce-hear-about-us' ) : $empty_value;
- }
- // for compatibility reasons.
- if(isset($options[$option])) {
- return $options[$option];
- }
- return $option;
- }