fs_request_get_bool

The NextGEN Gallery fs request get bool function.

Description

fs_request_get_bool( $key, (bool) $def = false ); 

Parameters (2)

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

Usage

  1. if ( !function_exists( 'fs_request_get_bool' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextgen-gallery/freemius/includes/fs-core-functions.php'; 
  3.  
  4. // The key. 
  5. $key = null; 
  6.  
  7. // The def. 
  8. $def = false; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = fs_request_get_bool($key, $def); 
  12.  

Defined (1)

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

/freemius/includes/fs-core-functions.php  
  1. function fs_request_get_bool( $key, $def = false ) { 
  2. if ( ! isset( $_REQUEST[ $key ] ) ) { 
  3. return $def; 
  4.  
  5. if ( 1 == $_REQUEST[ $key ] || 'true' === strtolower( $_REQUEST[ $key ] ) ) { 
  6. return true; 
  7.  
  8. if ( 0 == $_REQUEST[ $key ] || 'false' === strtolower( $_REQUEST[ $key ] ) ) { 
  9. return false; 
  10.  
  11. return $def;