Skip to content

Commit 825f78e

Browse files
Change processor name and args
1 parent 4e77262 commit 825f78e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/wp-includes/class-wp-block.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,10 @@ private function replace_html( string $block_content, string $attribute_name, $s
335335
case 'rich-text':
336336
if ( 'core/image' === $this->name && 'caption' === $attribute_name ) {
337337
// Create private anonymous class until the HTML API provides `set_inner_html` method.
338-
$bindings_processor = new class( $block_content, WP_HTML_Processor::CONSTRUCTOR_UNLOCK_CODE ) extends WP_HTML_Processor {
338+
$bindings_processor_builder = new class(
339+
'Do not use this, it will not work. It is only here to create a subclass and call the static creator method',
340+
WP_HTML_Processor::CONSTRUCTOR_UNLOCK_CODE
341+
) extends WP_HTML_Processor {
339342
/**
340343
* Replace the inner content of a figcaption element with the passed content.
341344
*
@@ -384,7 +387,7 @@ public function set_figcaption_inner_html( $new_content ) {
384387
}
385388
};
386389

387-
$block_reader = $bindings_processor::create_fragment( $block_content );
390+
$block_reader = $bindings_processor_builder::create_fragment( $block_content );
388391
if ( $block_reader->next_tag( 'figcaption' ) ) {
389392
$block_reader->set_figcaption_inner_html( $source_value );
390393
}

0 commit comments

Comments
 (0)