Uses
Uses | Description |
---|---|
wp-includes/rest-api/class-wp-rest-request.php: WP_REST_Request::get_parameter_order() | Retrieves the parameter priority order. |
Checks if a parameter exists in the request.
This allows distinguishing between an omitted parameter, and a parameter specifically set to null.
(string) (Required) Parameter name.
(bool) True if a param exists for the given key.
File: wp-includes/rest-api/class-wp-rest-request.php
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; }
Version | Description |
---|---|
5.3.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_request/has_param