Changeset 51894 for trunk/src/wp-includes/class-wp-block.php
- Timestamp:
- 10/06/2021 06:47:09 PM (4 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
r51841 r51894 59 59 60 60 /** 61 * Block type registry. 62 * 63 * @since 5.9.0 64 * @var WP_Block_Type_Registry 65 * @access protected 66 */ 67 protected $registry; 68 69 /** 61 70 * List of inner blocks (of this same class) 62 71 * … … 115 124 $registry = WP_Block_Type_Registry::get_instance(); 116 125 } 126 127 $this->registry = $registry; 117 128 118 129 $this->block_type = $registry->get_registered( $this->name ); … … 206 217 if ( ! $options['dynamic'] || empty( $this->block_type->skip_inner_blocks ) ) { 207 218 $index = 0; 219 208 220 foreach ( $this->inner_content as $chunk ) { 209 $block_content .= is_string( $chunk ) ? 210 $chunk : 211 $this->inner_blocks[ $index++ ]->render(); 221 if ( is_string( $chunk ) ) { 222 $block_content .= $chunk; 223 } else { 224 $inner_block = $this->inner_blocks[ $index ]; 225 $parent_block = $this; 226 227 /** This filter is documented in wp-includes/blocks.php */ 228 $pre_render = apply_filters( 'pre_render_block', null, $inner_block->parsed_block, $parent_block ); 229 230 if ( ! is_null( $pre_render ) ) { 231 $block_content .= $pre_render; 232 } else { 233 $source_block = $inner_block->parsed_block; 234 235 /** This filter is documented in wp-includes/blocks.php */ 236 $inner_block->parsed_block = apply_filters( 'render_block_data', $inner_block->parsed_block, $source_block, $parent_block ); 237 238 /** This filter is documented in wp-includes/blocks.php */ 239 $inner_block->context = apply_filters( 'render_block_context', $inner_block->context, $inner_block->parsed_block, $parent_block ); 240 241 $block_content .= $inner_block->render(); 242 } 243 244 $index++; 245 } 212 246 } 213 247 }
Note: See TracChangeset
for help on using the changeset viewer.