WP_REST_Request::offsetExists()
Checks if a parameter is set.
Method of the class: WP_REST_Request{}
No Hooks.
Return
true|false
. Whether the parameter is set.
Usage
$WP_REST_Request = new WP_REST_Request(); $WP_REST_Request->offsetExists( $offset );
- $offset(string) (required)
- Parameter name.
Changelog
Since 4.4.0 | Introduced. |
WP_REST_Request::offsetExists() WP REST Request::offsetExists code WP 6.7.1
public function offsetExists( $offset ) { $order = $this->get_parameter_order(); foreach ( $order as $type ) { if ( isset( $this->params[ $type ][ $offset ] ) ) { return true; } } return false; }