WordPress at a glance
function is not described

WP_REST_Meta_Fields::get_empty_value_for_type() protected WP 5.3.0

Gets the empty value for a schema type.

{} It's a method of the class: WP_REST_Meta_Fields{}

No Hooks.

Return

Mixed.

Usage

$result = WP_REST_Meta_Fields::get_empty_value_for_type( $type );
$type(string) (required)
The schema type.

Changelog

Since 5.3.0 Introduced.

Code of WP_REST_Meta_Fields::get_empty_value_for_type() WP 5.5.1

<?php
protected static function get_empty_value_for_type( $type ) {
	switch ( $type ) {
		case 'string':
			return '';
		case 'boolean':
			return false;
		case 'integer':
			return 0;
		case 'number':
			return 0.0;
		case 'array':
		case 'object':
			return array();
		default:
			return null;
	}
}