Changeset 56063 for trunk/src/wp-includes/block-patterns.php
- Timestamp:
- 06/27/2023 11:11:02 AM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-patterns.php
r55983 r56063 13 13 * 14 14 * @since 5.5.0 15 * @since 6.3.0 Added source to core block patterns. 15 16 * @access private 16 17 */ … … 30 31 31 32 foreach ( $core_block_patterns as $core_block_pattern ) { 32 register_block_pattern( 33 'core/' . $core_block_pattern, 34 require __DIR__ . '/block-patterns/' . $core_block_pattern . '.php' 35 ); 33 $pattern = require __DIR__ . '/block-patterns/' . $core_block_pattern . '.php'; 34 $pattern['source'] = 'core'; 35 register_block_pattern( 'core/' . $core_block_pattern, $pattern ); 36 36 } 37 37 } … … 191 191 * @since 6.2.0 Normalize the pattern from the API (snake_case) to the 192 192 * format expected by `register_block_pattern` (camelCase). 193 * @since 6.3.0 Add 'pattern-directory/core' to the pattern's 'source'. 193 194 * 194 195 * @param WP_Screen $deprecated Unused. Formerly the screen that the current request was triggered from. … … 225 226 226 227 foreach ( $patterns as $pattern ) { 228 $pattern['source'] = 'pattern-directory/core'; 227 229 $normalized_pattern = wp_normalize_remote_block_pattern( $pattern ); 228 230 $pattern_name = 'core/' . sanitize_title( $normalized_pattern['title'] ); … … 238 240 * @since 6.2.0 Normalized the pattern from the API (snake_case) to the 239 241 * format expected by `register_block_pattern()` (camelCase). 242 * @since 6.3.0 Add 'pattern-directory/featured' to the pattern's 'source'. 240 243 */ 241 244 function _load_remote_featured_patterns() { … … 259 262 $registry = WP_Block_Patterns_Registry::get_instance(); 260 263 foreach ( $patterns as $pattern ) { 264 $pattern['source'] = 'pattern-directory/featured'; 261 265 $normalized_pattern = wp_normalize_remote_block_pattern( $pattern ); 262 266 $pattern_name = sanitize_title( $normalized_pattern['title'] ); … … 276 280 * @since 6.2.0 Normalized the pattern from the API (snake_case) to the 277 281 * format expected by `register_block_pattern()` (camelCase). 282 * @since 6.3.0 Add 'pattern-directory/theme' to the pattern's 'source'. 278 283 * @access private 279 284 */ … … 302 307 $patterns_registry = WP_Block_Patterns_Registry::get_instance(); 303 308 foreach ( $patterns as $pattern ) { 309 $pattern['source'] = 'pattern-directory/theme'; 304 310 $normalized_pattern = wp_normalize_remote_block_pattern( $pattern ); 305 311 $pattern_name = sanitize_title( $normalized_pattern['title'] );
Note: See TracChangeset
for help on using the changeset viewer.