From 4e5211a6917469a30cc08cac3ee8e91e80a6952a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helen=20Hou-Sand=C3=AD?= Date: Thu, 10 Sep 2020 16:34:11 +0000 Subject: [PATCH] REST API: Include attribute name in schema validation error message. Props bobbingwide. Fixes #51231. Built from https://develop.svn.wordpress.org/trunk@48969 git-svn-id: http://core.svn.wordpress.org/trunk@48731 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-block-type.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/class-wp-block-type.php b/wp-includes/class-wp-block-type.php index 572c3c39c1..93e1615f62 100644 --- a/wp-includes/class-wp-block-type.php +++ b/wp-includes/class-wp-block-type.php @@ -209,7 +209,7 @@ class WP_Block_Type { */ public function prepare_attributes_for_render( $attributes ) { // If there are no attribute definitions for the block type, skip - // processing and return vebatim. + // processing and return verbatim. if ( ! isset( $this->attributes ) ) { return $attributes; } @@ -227,7 +227,7 @@ class WP_Block_Type { // its default, if one exists. This occurs by virtue of the missing // attributes loop immediately following. If there is not a default // assigned, the attribute value should remain unset. - $is_valid = rest_validate_value_from_schema( $value, $schema ); + $is_valid = rest_validate_value_from_schema( $value, $schema, $attribute_name ); if ( is_wp_error( $is_valid ) ) { unset( $attributes[ $attribute_name ] ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 69c46c00f4..97c1644559 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.6-alpha-48968'; +$wp_version = '5.6-alpha-48969'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.