ic::get_empty_value_for_type( $schema['type'] );
}
if ( is_wp_error( rest_validate_value_from_schema( $value, $schema ) ) ) {
return null;
}
return rest_sanitize_value_from_schema( $value, $schema );
}
/**
* Check the 'meta' value of a request is an associative array.
*
* @since 4.7.0
*
* @param mixed $value The meta value submitted in the request.
* @param WP_REST_Request $request Full details about the request.
* @param string $param The parameter name.
* @return array|false The meta array, if valid, false otherwise.
*/
public function check_meta_is_array( $value, $request, $param ) {
if ( ! is_array( $value ) ) {
return false;
}
return $value;
}
/**
* Recursively add additionalProperties = false to all objects in a schema if no additionalProperties setting
* is specified.
*
* This is needed to restrict properties of objects in meta values to only
* registered items, as the REST API will allow additional properties by
* default.
*
* @since 5.3.0
* @deprecated 5.6.0 Use rest_default_additional_properties_to_false() instead.
*
* @param array $schema The schema array.
* @return array
*/
protected function default_additional_properties_to_false( $schema ) {
_deprecated_function( __METHOD__, '5.6.0', 'rest_default_additional_properties_to_false()' );
return rest_default_additional_properties_to_false( $schema );
}
/**
* Gets the empty value for a schema type.
*
* @since 5.3.0
*
* @param string $type The schema type.
* @return mixed
*/
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;
}
}
}
Fatal error: Uncaught Error: Class 'WP_REST_Meta_Fields' not found in /var/www/html/helitower.com.br/web/wp-includes/rest-api/fields/class-wp-rest-comment-meta-fields.php:17
Stack trace:
#0 /var/www/html/helitower.com.br/web/wp-settings.php(323): require()
#1 /var/www/html/helitower.com.br/web/wp-config.php(99): require_once('/var/www/html/h...')
#2 /var/www/html/helitower.com.br/web/wp-load.php(50): require_once('/var/www/html/h...')
#3 /var/www/html/helitower.com.br/web/wp-blog-header.php(13): require_once('/var/www/html/h...')
#4 /var/www/html/helitower.com.br/web/index.php(18): require('/var/www/html/h...')
#5 {main}
thrown in /var/www/html/helitower.com.br/web/wp-includes/rest-api/fields/class-wp-rest-comment-meta-fields.php on line 17
Fatal error: Uncaught Error: Call to a member function set() on null in /var/www/html/helitower.com.br/web/wp-includes/l10n.php:854
Stack trace:
#0 /var/www/html/helitower.com.br/web/wp-includes/l10n.php(957): load_textdomain('default', '/var/www/html/h...', 'pt_BR')
#1 /var/www/html/helitower.com.br/web/wp-includes/class-wp-fatal-error-handler.php(49): load_default_textdomain()
#2 [internal function]: WP_Fatal_Error_Handler->handle()
#3 {main}
thrown in /var/www/html/helitower.com.br/web/wp-includes/l10n.php on line 854