Make WordPress Core

Ticket #51231: 51231.diff

File 51231.diff, 1.0 KB (added by bobbingwide, 4 years ago)

TRAC 51231 - pass $attribute_name to rest_validate_value_from_schema. Correct typo for verbatim

  • src/wp-includes/class-wp-block-type.php

    diff --git a/src/wp-includes/class-wp-block-type.php b/src/wp-includes/class-wp-block-type.php
    index 572c3c39c1..93e1615f62 100644
    a b class WP_Block_Type { 
    209209         */
    210210        public function prepare_attributes_for_render( $attributes ) {
    211211                // If there are no attribute definitions for the block type, skip
    212                 // processing and return vebatim.
     212                // processing and return verbatim.
    213213                if ( ! isset( $this->attributes ) ) {
    214214                        return $attributes;
    215215                }
    class WP_Block_Type { 
    227227                        // its default, if one exists. This occurs by virtue of the missing
    228228                        // attributes loop immediately following. If there is not a default
    229229                        // assigned, the attribute value should remain unset.
    230                         $is_valid = rest_validate_value_from_schema( $value, $schema );
     230                        $is_valid = rest_validate_value_from_schema( $value, $schema, $attribute_name );
    231231                        if ( is_wp_error( $is_valid ) ) {
    232232                                unset( $attributes[ $attribute_name ] );
    233233                        }