From f720cdc94213e6ae8067548045f4818fab4bff1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Zi=C3=83=C2=B3=C3=85=E2=80=9Akowski?= Date: Fri, 23 Feb 2024 09:18:34 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@57700 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-block.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/class-wp-block.php b/src/wp-includes/class-wp-block.php index 8d11eba20d..60c026e0ac 100644 --- a/src/wp-includes/class-wp-block.php +++ b/src/wp-includes/class-wp-block.php @@ -236,7 +236,7 @@ class WP_Block { $supported_block_attributes = array( 'core/paragraph' => array( 'content' ), 'core/heading' => array( 'content' ), - 'core/image' => array( 'url', 'title', 'alt' ), + 'core/image' => array( 'id', 'url', 'title', 'alt' ), 'core/button' => array( 'url', 'text', 'linkTarget', 'rel' ), ); @@ -289,7 +289,7 @@ class WP_Block { */ private function replace_html( string $block_content, string $attribute_name, $source_value ) { $block_type = $this->block_type; - if ( ! isset( $block_type->attributes[ $attribute_name ] ) ) { + if ( ! isset( $block_type->attributes[ $attribute_name ]['source'] ) ) { return $block_content; }