Checks if a parameter exists in the request.
Description
This allows distinguishing between an omitted parameter, and a parameter specifically set to null.
Parameters
$key
stringrequired- Parameter name.
Source
public function has_param( $key ) {
$order = $this->get_parameter_order();
foreach ( $order as $type ) {
if ( is_array( $this->params[ $type ] ) && array_key_exists( $key, $this->params[ $type ] ) ) {
return true;
}
}
return false;
}
Changelog
Version | Description |
---|---|
5.3.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.