wc_pos_get_option

The WooCommerce POS wc pos get option function.

Description

wc_pos_get_option( $id, (bool) $key = false ); 

Parameters (2)

0. $id
The id.
1. $key — Optional. (bool) => false
The key.

Usage

  1. if ( !function_exists( 'wc_pos_get_option' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-pos/includes/wc-pos-functions.php'; 
  3.  
  4. // The id. 
  5. $id = null; 
  6.  
  7. // The key. 
  8. $key = false; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wc_pos_get_option($id, $key); 
  12.  

Defined (1)

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

/includes/wc-pos-functions.php  
  1. function wc_pos_get_option( $id, $key = false ) { 
  2. $handlers = (array) WC_POS_Settings::handlers(); 
  3. if( !array_key_exists( $id, $handlers ) ) 
  4. return false; 
  5.  
  6. $settings = $handlers[$id]::get_instance(); 
  7. return $settings->get( $key );