Skip to content

Commit 0fd7a10

Browse files
committed
Simplify set_inner_html function
1 parent 62cc6d3 commit 0fd7a10

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,12 @@ public function render( $options = array() ) {
582582
*/
583583
class PrivateProcessor extends WP_HTML_Processor {
584584

585-
public function set_inner_html( ?string $html ) {
585+
/**
586+
* @param string $html
587+
*
588+
* @return bool
589+
*/
590+
public function set_inner_html( string $html ): bool {
586591
if ( $this->is_virtual() ) {
587592
return false;
588593
}
@@ -607,14 +612,9 @@ public function set_inner_html( ?string $html ) {
607612
/* return false;*/
608613
/*}*/
609614

610-
if ( null === $html ) {
611-
$html = '';
612-
}
613615
if ( '' !== $html ) {
614-
$fragment_parser = $this->spawn_fragment_parser( $html );
615-
if (
616-
null === $fragment_parser
617-
) {
616+
$fragment_parser = $this->create_fragment_at_current_node( $html );
617+
if ( null === $fragment_parser ) {
618618
return false;
619619
}
620620

0 commit comments

Comments
 (0)