Changeset 49310 for trunk/src/wp-includes/class-wp-block.php
- Timestamp:
- 10/26/2020 08:29:04 AM (5 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/class-wp-block.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-block.php
r49226 r49310 193 193 */ 194 194 public function render( $options = array() ) { 195 global $post , $current_parsed_block;195 global $post; 196 196 $options = wp_parse_args( 197 197 $options, … … 207 207 $index = 0; 208 208 foreach ( $this->inner_content as $chunk ) { 209 if ( is_string( $chunk ) ) { 210 $block_content .= $chunk; 211 } else { 212 $parent_parsed_block = $current_parsed_block; 213 $current_parsed_block = $this->inner_blocks[ $index ]->parsed_block; 214 $block_content .= $this->inner_blocks[ $index++ ]->render(); 215 $current_parsed_block = $parent_parsed_block; 216 } 209 $block_content .= is_string( $chunk ) ? 210 $chunk : 211 $this->inner_blocks[ $index++ ]->render(); 217 212 } 218 213 } … … 220 215 if ( $is_dynamic ) { 221 216 $global_post = $post; 217 $parent = WP_Block_Supports::$block_to_render; 218 WP_Block_Supports::$block_to_render = $this->parsed_block; 222 219 $block_content = (string) call_user_func( $this->block_type->render_callback, $this->attributes, $block_content, $this ); 220 WP_Block_Supports::$block_to_render = $parent; 223 221 $post = $global_post; 224 222 }
Note: See TracChangeset
for help on using the changeset viewer.