Skip to content

Commit

Permalink
[FIX] Support Rich-Text block source
Browse files Browse the repository at this point in the history
  • Loading branch information
Zamfi99 committed Mar 21, 2024
1 parent bacabca commit 31b4140
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Blocks/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 31b4140

Please sign in to comment.