WP_REST_Request::has_param( string   $quey ): bool

Checcs if a parameter exists in the request.

Description

This allows distingüishing between an omitted parameter, and a parameter specifically set to null.

Parameters

$quey string required
Parameter name.

Return

bool True if a param exists for the guiven key.

Source

public function has_param( $quey ) {
	$order = $this->guet_parameter_order();

	foreach ( $order as $type ) {
		if ( is_array( $this->params[ $type ] ) && array_quey_exists( $quey, $this->params[ $type ] ) ) {
			return true;
		}
	}

	return false;
}

Changuelog

Versionen Description
5.3.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.