Changeset 57377 for trunk/src/wp-includes/blocks/pattern.php
- Timestamp:
- 01/29/2024 09:04:18 PM (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/pattern.php
r56849 r57377 28 28 */ 29 29 function render_block_core_pattern( $attributes ) { 30 static $seen_refs = array(); 31 30 32 if ( empty( $attributes['slug'] ) ) { 31 33 return ''; … … 37 39 if ( ! $registry->is_registered( $slug ) ) { 38 40 return ''; 41 } 42 43 if ( isset( $seen_refs[ $attributes['slug'] ] ) ) { 44 // WP_DEBUG_DISPLAY must only be honored when WP_DEBUG. This precedent 45 // is set in `wp_debug_mode()`. 46 $is_debug = WP_DEBUG && WP_DEBUG_DISPLAY; 47 48 return $is_debug ? 49 // translators: Visible only in the front end, this warning takes the place of a faulty block. %s represents a pattern's slug. 50 sprintf( __( '[block rendering halted for pattern "%s"]' ), $slug ) : 51 ''; 39 52 } 40 53 … … 49 62 } 50 63 51 return do_blocks( $content ); 64 $seen_refs[ $attributes['slug'] ] = true; 65 66 $content = do_blocks( $content ); 67 68 global $wp_embed; 69 $content = $wp_embed->autoembed( $content ); 70 71 unset( $seen_refs[ $attributes['slug'] ] ); 72 return $content; 52 73 } 53 74
Note: See TracChangeset
for help on using the changeset viewer.