From 31b41408e3b7b4b11a06f6623e9c799e36075816 Mon Sep 17 00:00:00 2001 From: Zamfi99 Date: Thu, 21 Mar 2024 17:29:44 +0200 Subject: [PATCH] [FIX] Support Rich-Text block source --- src/Blocks/Block.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Blocks/Block.php b/src/Blocks/Block.php index 8a9b63fb..b6ba4d11 100644 --- a/src/Blocks/Block.php +++ b/src/Blocks/Block.php @@ -57,6 +57,16 @@ protected static function source_attributes( $node, $type ) { $source = $value['source'] ?? null; switch ( $source ) { + case 'rich-text': + // Most 'html' sources were converted to 'rich-text' in WordPress 6.5. + // https://github.com/WordPress/gutenberg/pull/43204 + $source_node = ! empty( $value['selector'] ) ? $node->findOne( $value['selector'] ) : $node; + + if ( $source_node ) { + $result[ $key ] = $source_node->innerhtml; + } + + break; case 'html': $source_node = ! empty( $value['selector'] ) ? $node->findOne( $value['selector'] ) : $node;