bbp_sanitize_val

Echo sanitized $_REQUEST value.

Description

bbp_sanitize_val( (string) $request = '', (string) $input_type = 'text' ); 

Use the $input_type parameter to properly process the value. This ensures correct sanitization of the value for the receiving input.

Parameters (2)

0. $request — Optional. (string) => ''
Name of $_REQUEST to look for
1. $input_type — Optional. (string) => 'text'
Type of input. Default: text. Accepts: textarea|password|select|radio|checkbox

Usage

  1. if ( !function_exists( 'bbp_sanitize_val' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/common/template.php'; 
  3.  
  4. // Name of $_REQUEST to look for 
  5. $request = ''; 
  6.  
  7. // Type of input. Default: text. Accepts: 
  8. // textarea|password|select|radio|checkbox 
  9. $input_type = 'text'; 
  10.  
  11. // NOTICE! Understand what this does before running. 
  12. $result = bbp_sanitize_val($request, $input_type); 
  13.  

Defined (1)

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

/includes/common/template.php  
  1. function bbp_sanitize_val( $request = '', $input_type = 'text' ) { 
  2. echo bbp_get_sanitize_val( $request, $input_type );