WP_REST_Request::offsetExists() WordPress Method
The WP_REST_Request::offsetExists() method is used to check if a given offset exists in the request body. This is useful for checking if a given parameter is set in the request body.
WP_REST_Request::offsetExists( $offset ) #
Source
File: wp-includes/rest-api/class-wp-rest-request.php
public function offsetExists( $offset ) {
$order = $this->get_parameter_order();
foreach ( $order as $type ) {
if ( isset( $this->params[ $type ][ $offset ] ) ) {
return true;
}
}
return false;
}
Expand full source codeCollapse full source codeView on TracView on GitHub