wchau_get_option_value

The WooCommerce Hear About Us wchau get option value function.

Description

wchau_get_option_value( $option, (constant) $empty_value = null ); 

Parameters (2)

0. $option
The option.
1. $empty_value — Optional. (constant) => null
The empty value.

Usage

  1. if ( !function_exists( 'wchau_get_option_value' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-hear-about-us/includes/wchau-functions.php'; 
  3.  
  4. // The option. 
  5. $option = null; 
  6.  
  7. // The empty value. 
  8. $empty_value = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wchau_get_option_value($option, $empty_value); 
  12.  

Defined (1)

The function is defined in the following location(s).

/includes/wchau-functions.php  
  1. function wchau_get_option_value($option, $empty_value = null) { 
  2. $options = WCHAU_Custom_Field::get_options(); 
  3. if ( empty( $option ) ) { 
  4. return !isset($empty_value) ? __( 'N/A', 'woocommerce-hear-about-us' ) : $empty_value; 
  5.  
  6. // for compatibility reasons. 
  7. if(isset($options[$option])) { 
  8. return $options[$option]; 
  9.  
  10. return $option;