WP_REST_Meta_Fields::check_meta_is_array( mixed $value, WP_REST_Request $request, string $param ): array|false

In this article

Check the ‘meta’ value of a request is an associative array.

Parameters

$valuemixedrequired
The meta value submitted in the request.
$requestWP_REST_Requestrequired
Full details about the request.
$paramstringrequired
The parameter name.

Return

array|false The meta array, if valid, false otherwise.

Source

public function check_meta_is_array( $value, $request, $param ) {
	if ( ! is_array( $value ) ) {
		return false;
	}

	return $value;
}

Changelog

VersionDescription
4.7.0Introduced.

User Contributed Notes

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