is->attributes[ $attribute_name ] ) ) {
continue;
}
$schema = $this->attributes[ $attribute_name ];
// Validate value by JSON schema. An invalid value should revert to
// 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, $attribute_name );
if ( is_wp_error( $is_valid ) ) {
unset( $attributes[ $attribute_name ] );
}
}
// Populate values of any missing attributes for which the block type
// defines a default.
$missing_schema_attributes = array_diff_key( $this->attributes, $attributes );
foreach ( $missing_schema_attributes as $attribute_name => $schema ) {
if ( isset( $schema['default'] ) ) {
$attributes[ $attribute_name ] = $schema['default'];
}
}
return $attributes;
}
/**
* Sets block type properties.
*
* @since 5.0.0
*
* @param array|string $args Array or string of arguments for registering a block type.
* See WP_Block_Type::__construct() for information on accepted arguments.
*/
public function set_props( $args ) {
$args = wp_parse_args(
$args,
array(
'render_callback' => null,
)
);
$args['name'] = $this->name;
// Setup attributes if needed.
if ( ! isset( $args['attributes'] ) || ! is_array( $args['attributes'] ) ) {
$args['attributes'] = array();
}
// Register core attributes.
foreach ( static::GLOBAL_ATTRIBUTES as $attr_key => $attr_schema ) {
if ( ! array_key_exists( $attr_key, $args['attributes'] ) ) {
$args['attributes'][ $attr_key ] = $attr_schema;
}
}
/**
* Filters the arguments for registering a block type.
*
* @since 5.5.0
*
* @param array $args Array of arguments for registering a block type.
* @param string $block_type Block type name including namespace.
*/
$args = apply_filters( 'register_block_type_args', $args, $this->name );
foreach ( $args as $property_name => $property_value ) {
$this->$property_name = $property_value;
}
}
/**
* Get all available block attributes including possible layout attribute from Columns block.
*
* @since 5.0.0
*
* @return array Array of attributes.
*/
public function get_attributes() {
return is_array( $this->attributes ) ?
$this->attributes :
array();
}
}
Fatal error: require(): Failed opening required '/home/healths/public_html/wp-includes/block-supports/background.php' (include_path='.:') in /home/healths/public_html/wp-settings.php on line 345
Fatal error: Uncaught Error: Call to a member function set() on null in /home/healths/public_html/wp-includes/l10n.php:806
Stack trace:
#0 /home/healths/public_html/wp-includes/l10n.php(900): load_textdomain()
#1 /home/healths/public_html/wp-includes/class-wp-fatal-error-handler.php(47): load_default_textdomain()
#2 [internal function]: WP_Fatal_Error_Handler->handle()
#3 {main}
thrown in /home/healths/public_html/wp-includes/l10n.php on line 806