WP_REST_Meta_Fields::check_meta_is_array() WordPress Method

The WP_REST_Meta_Fields::check_meta_is_array() is a method of the WP_REST_Meta_Fields class. This function is used to check if a given meta key is an array.

WP_REST_Meta_Fields::check_meta_is_array( mixed $value, WP_REST_Request $request, string $param ) #

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


Parameters

$value

(mixed)(Required)The meta value submitted in the request.

$request

(WP_REST_Request)(Required)Full details about the request.

$param

(string)(Required)The parameter name.


Top ↑

Return

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


Top ↑

Source

File: wp-includes/rest-api/fields/class-wp-rest-meta-fields.php

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

		return $value;
	}

Top ↑

Changelog

Changelog
VersionDescription
4.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.