Changeset 43752 for branches/5.0/src/wp-includes/class-wp-block-parser.php
- Timestamp:
- 10/18/2018 11:53:49 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0/src/wp-includes/class-wp-block-parser.php
r43751 r43752 307 307 */ 308 308 $stack_top = array_pop( $this->stack ); 309 $stack_top->block->innerHTML .= substr( $this->document, $stack_top->prev_offset, $start_offset - $stack_top->prev_offset ); 309 310 $html = substr( $this->document, $stack_top->prev_offset, $start_offset - $stack_top->prev_offset ); 311 if ( $stack_top->block->innerBlocks ) { 312 $stack_top->block->innerBlocks[] = (array) $this->freeform( $html ); 313 } else { 314 $stack_top->block->innerHTML = $html; 315 } 316 310 317 $stack_top->prev_offset = $start_offset + $token_length; 311 318 … … 441 448 function add_inner_block( WP_Block_Parser_Block $block, $token_start, $token_length, $last_offset = null ) { 442 449 $parent = $this->stack[ count( $this->stack ) - 1 ]; 443 $parent->block->innerBlocks[] = $block;444 $parent->block->inner HTML .= substr( $this->document, $parent->prev_offset, $token_start - $parent->prev_offset );450 $parent->block->innerBlocks[] = (array) $this->freeform( substr( $this->document, $parent->prev_offset, $token_start - $parent->prev_offset ) ); 451 $parent->block->innerBlocks[] = (array) $block; 445 452 $parent->prev_offset = $last_offset ? $last_offset : $token_start + $token_length; 446 453 } … … 457 464 $prev_offset = $stack_top->prev_offset; 458 465 459 $ stack_top->block->innerHTML .= isset( $end_offset )466 $html = isset( $end_offset ) 460 467 ? substr( $this->document, $prev_offset, $end_offset - $prev_offset ) 461 468 : substr( $this->document, $prev_offset ); 469 470 if ( $stack_top->block->innerBlocks ) { 471 $stack_top->block->innerBlocks[] = (array) $this->freeform( $html ); 472 } else { 473 $stack_top->block->innerHTML = $html; 474 } 462 475 463 476 if ( isset( $stack_top->leading_html_start ) ) {
Note: See TracChangeset
for help on using the changeset viewer.