pmpro_setOption

The Paid Memberships Pro pmpro setOption function.

Description

pmpro_setOption( $s, (constant) $v = NULL ); 

Parameters (2)

0. $s
The s.
1. $v — Optional. (constant) => NULL
The v.

Usage

  1. if ( !function_exists( 'pmpro_setOption' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/includes/functions.php'; 
  3.  
  4. // The s. 
  5. $s = null; 
  6.  
  7. // The v. 
  8. $v = NULL; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = pmpro_setOption($s, $v); 
  12.  

Defined (1)

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

/includes/functions.php  
  1. function pmpro_setOption($s, $v = NULL) 
  2. //no value is given,setv to the p var 
  3. if($v === NULL && isset($_POST[$s])) 
  4. $v = $_POST[$s]; 
  5.  
  6. if(is_array($v)) 
  7. $v = implode(", ", $v); 
  8. else 
  9. $v = trim($v); 
  10.  
  11. return update_option("pmpro_" . $s, $v);