wc_pos_update_option

Add or update a WordPress option.

Description

wc_pos_update_option( (string) $name, (mixed) $value, (string) $autoload = 'no' ); 

The option will _not_ auto-load by default.

Parameters (3)

0. $name (string)
The name.
1. $value (mixed)
The value.
2. $autoload — Optional. (string) => 'no'
The autoload.

Usage

  1. if ( !function_exists( 'wc_pos_update_option' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-pos/includes/wc-pos-functions.php'; 
  3.  
  4. // The name. 
  5. $name = ''; 
  6.  
  7. // The value. 
  8. $value = null; 
  9.  
  10. // The autoload. 
  11. $autoload = 'no'; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = wc_pos_update_option($name, $value, $autoload); 
  15.  

Defined (1)

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

/includes/wc-pos-functions.php  
  1. function wc_pos_update_option( $name, $value, $autoload = 'no' ) { 
  2. $success = add_option( $name, $value, '', $autoload ); 
  3.  
  4. if ( ! $success ) { 
  5. $success = update_option( $name, $value ); 
  6.  
  7. return $success;