Make WordPress Core

Changeset 57700


Ignore:
Timestamp:
02/23/2024 09:18:34 AM (2 months ago)
Author:
gziolo
Message:

Editor: Add id to the supported Image's binding attributes

Syncs changes from the Gutenberg plugin: https://github.com/WordPress/gutenberg/pull/59194.

Fixes #60577.
Props kevin940726, ankit-k-gupta, sonali844, harshalkadu, gziolo.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-block.php

    r57641 r57700  
    237237            'core/paragraph' => array( 'content' ),
    238238            'core/heading'   => array( 'content' ),
    239             'core/image'     => array( 'url', 'title', 'alt' ),
     239            'core/image'     => array( 'id', 'url', 'title', 'alt' ),
    240240            'core/button'    => array( 'url', 'text', 'linkTarget', 'rel' ),
    241241        );
     
    290290    private function replace_html( string $block_content, string $attribute_name, $source_value ) {
    291291        $block_type = $this->block_type;
    292         if ( ! isset( $block_type->attributes[ $attribute_name ] ) ) {
     292        if ( ! isset( $block_type->attributes[ $attribute_name ]['source'] ) ) {
    293293            return $block_content;
    294294        }
Note: See TracChangeset for help on using the changeset viewer.