woocommerce_settings_get_option

Get a setting from the settings API.

Description

(string) woocommerce_settings_get_option( (string) $option_name, (string) $default = '' ); 

Returns (string)

Parameters (2)

0. $option_name (string)
The option name.
1. $default — Optional. (string) => ''
The default.

Usage

  1. if ( !function_exists( 'woocommerce_settings_get_option' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/admin/wc-admin-functions.php'; 
  3.  
  4. // The option name. 
  5. $option_name = ''; 
  6.  
  7. // The default. 
  8. $default = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = woocommerce_settings_get_option($option_name, $default); 
  12.  

Defined (1)

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

/includes/admin/wc-admin-functions.php  
  1. function woocommerce_settings_get_option( $option_name, $default = '' ) { 
  2.  
  3. if ( ! class_exists( 'WC_Admin_Settings', false ) ) { 
  4. include( dirname( __FILE__ ) . '/class-wc-admin-settings.php' ); 
  5.  
  6. return WC_Admin_Settings::get_option( $option_name, $default );