- Timestamp:
- 09/21/2023 04:16:05 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-block-patterns-registry.php
r55693 r56649 166 166 } 167 167 168 return $this->registered_patterns[ $pattern_name ]; 168 $pattern = $this->registered_patterns[ $pattern_name ]; 169 $blocks = parse_blocks( $pattern['content'] ); 170 $before_block_visitor = make_before_block_visitor( $pattern ); 171 $after_block_visitor = make_after_block_visitor( $pattern ); 172 $pattern['content'] = traverse_and_serialize_blocks( $blocks, $before_block_visitor, $after_block_visitor ); 173 174 return $pattern; 169 175 } 170 176 … … 179 185 */ 180 186 public function get_all_registered( $outside_init_only = false ) { 181 returnarray_values(187 $patterns = array_values( 182 188 $outside_init_only 183 189 ? $this->registered_patterns_outside_init 184 190 : $this->registered_patterns 185 191 ); 192 193 foreach ( $patterns as $index => $pattern ) { 194 $blocks = parse_blocks( $pattern['content'] ); 195 $before_block_visitor = make_before_block_visitor( $pattern ); 196 $after_block_visitor = make_after_block_visitor( $pattern ); 197 $patterns[ $index ]['content'] = traverse_and_serialize_blocks( $blocks, $before_block_visitor, $after_block_visitor ); 198 } 199 return $patterns; 186 200 } 187 201
Note: See TracChangeset
for help on using the changeset viewer.