-
Notifications
You must be signed in to change notification settings - Fork 116
Function Reference
Gets a specific external variable by name and optionally filters it.
This is a polyfill function intended to be used in place of PHP's filter_input()
function, which can occasionally be unreliable. See issue #257 for more info.
(mixed) Value of the requested variable on success, FALSE
if the filter fails, or NULL
if the $variable_name
is not set.
$type
(int) One of INPUT_GET
, INPUT_POST
, INPUT_COOKIE
, INPUT_SERVER
, or INPUT_ENV
.
$variable_name
(string) Name of a variable to get.
$filter
(int) The ID of the filter to apply. The Types of filters manual page lists the available filters.
$options
(mixed) Associative array of options or bitwise disjunction of flags. If filter accepts options, flags can be provided in "flags" field of array.
Since: 1.2.5
Source file: includes/functions.php
wp_stream_filter_input( $type, $variable_name, $filter = null, $options = array() );
Filters a variable with a specified filter.
This is a polyfill function intended to be used in place of PHP's filter_var()
function, which can occasionally be unreliable. See issue #257 for more info.
(mixed) Returns the filtered data, or FALSE
if the filter fails.
$var
(string) Value to filter.
$filter
(int) The ID of the filter to apply. The Types of filters manual page lists the available filters.
$options
(mixed) Associative array of options or bitwise disjunction of flags. If filter accepts options, flags can be provided in "flags" field of array. For the "callback" filter, callable type should be passed. The callback must accept one argument, the value to be filtered, and return the value after filtering/sanitizing it.
Since: 1.2.5
Source file: includes/functions.php
wp_stream_filter_var( $var, $filter = null, $options = array() );