bbp_get_sanitize_val( string $request = '', string $input_type = 'text' )
Return sanitized $_REQUEST value.
Description Description
Use the $input_type parameter to properly process the value. This ensures correct sanitization of the value for the receiving input.
Parameters Parameters
- $request
-
(Optional) Name of $_REQUEST to look for
Default value: ''
- $input_type
-
(Optional) Type of input. Default: text. Accepts: textarea|password|select|radio|checkbox
Default value: 'text'
Return Return
(string) Sanitized value ready for screen display
Source Source
File: includes/common/template.php
function bbp_get_sanitize_val( $request = '', $input_type = 'text' ) { // Check that requested if ( empty( $_REQUEST[ $request ] ) ) { return false; } // Set request varaible $pre_ret_val = $_REQUEST[ $request ]; // Treat different kinds of fields in different ways switch ( $input_type ) { case 'text' : case 'textarea' : $retval = esc_attr( wp_unslash( $pre_ret_val ) ); break; case 'password' : case 'select' : case 'radio' : case 'checkbox' : default : $retval = esc_attr( $pre_ret_val ); break; } // Filter & return return apply_filters( 'bbp_get_sanitize_val', $retval, $request, $input_type ); }
Changelog Changelog
Version | Description |
---|---|
2.0.0 | Introduced. |