Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use args
  • Loading branch information
Mamaduka committed Apr 26, 2022
commit ae19fc5fc8b6d278d538e3fdd5b7d01160f976ea
8 changes: 4 additions & 4 deletions src/wp-includes/class-wp-block-type.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,14 @@ public function set_props( $args ) {
$args['name'] = $this->name;

// Setup attributes if needed.
if ( ! is_array( $this->attributes ) ) {
$this->attributes = array();
if ( ! isset( $args['attributes'] ) ) {
$args['attributes'] = array();
}

// Register core attributes.
foreach ( static::GLOBAL_ATTRIBUTES as $attr_key => $attr_schema ) {
if ( ! array_key_exists( $attr_key, $this->attributes ) ) {
$this->attributes[ $attr_key ] = $attr_schema;
if ( ! array_key_exists( $attr_key, $args['attributes'] ) ) {
$args['attributes'][ $attr_key ] = $attr_schema;
}
}

Expand Down