Changeset 59101 for trunk/src/wp-includes/blocks.php
- Timestamp:
- 09/27/2024 09:18:46 AM (20 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/blocks.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks.php
r59081 r59101 1036 1036 * 1037 1037 * @since 6.6.0 1038 * @since 6.7.0 Injects the `theme` attribute into Template Part blocks, even if no hooked blocks are registered. 1038 1039 * @access private 1039 1040 * … … 1048 1049 function apply_block_hooks_to_content( $content, $context, $callback = 'insert_hooked_blocks' ) { 1049 1050 $hooked_blocks = get_hooked_blocks(); 1050 if ( empty( $hooked_blocks ) && ! has_filter( 'hooked_block_types' ) ) { 1051 return $content; 1051 1052 $before_block_visitor = '_inject_theme_attribute_in_template_part_block'; 1053 $after_block_visitor = null; 1054 if ( ! empty( $hooked_blocks ) || has_filter( 'hooked_block_types' ) ) { 1055 $before_block_visitor = make_before_block_visitor( $hooked_blocks, $context, $callback ); 1056 $after_block_visitor = make_after_block_visitor( $hooked_blocks, $context, $callback ); 1052 1057 } 1053 1058 1054 1059 $blocks = parse_blocks( $content ); 1055 1056 $before_block_visitor = make_before_block_visitor( $hooked_blocks, $context, $callback );1057 $after_block_visitor = make_after_block_visitor( $hooked_blocks, $context, $callback );1058 1060 1059 1061 return traverse_and_serialize_blocks( $blocks, $before_block_visitor, $after_block_visitor );
Note: See TracChangeset
for help on using the changeset viewer.