pmpro_getParam

The Paid Memberships Pro pmpro getParam function.

Description

pmpro_getParam( $index, (string) $method = 'REQUEST', (string) $default = '' ); 

Parameters (3)

0. $index
The index.
1. $method — Optional. (string) => 'REQUEST'
The method.
2. $default — Optional. (string) => ''
The default.

Usage

  1. if ( !function_exists( 'pmpro_getParam' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/includes/functions.php'; 
  3.  
  4. // The index. 
  5. $index = null; 
  6.  
  7. // The method. 
  8. $method = 'REQUEST'; 
  9.  
  10. // The default. 
  11. $default = ''; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = pmpro_getParam($index, $method, $default); 
  15.  

Defined (1)

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

/includes/functions.php  
  1. function pmpro_getParam($index, $method = "REQUEST", $default = "") 
  2. if($method == "REQUEST") 
  3. if(!empty($_REQUEST[$index])) 
  4. return $_REQUEST[$index]; 
  5. elseif($method == "POST") 
  6. if(!empty($_POST[$index])) 
  7. return $_POST[$index]; 
  8. elseif($method == "GET") 
  9. if(!empty($_GET[$index])) 
  10. return $_GET[$index]; 
  11.  
  12. return $default;