| @@ -12,10 +12,8 @@ | ||
| 12 | 12 | * |
| 13 | 13 | * @return string Rendered HTML of the referenced block. |
| 14 | 14 | */ |
| 15 | 15 | function gutenberg_render_block_core_block( $attributes ) { |
| 16 | - static $seen_refs = array(); | |
| 17 | - | |
| 18 | 16 | if ( empty( $attributes['ref'] ) ) { |
| 19 | 17 | return ''; |
| 20 | 18 | } |
| 21 | 19 | |
| @@ -23,34 +21,13 @@ | ||
| 23 | 21 | if ( ! $reusable_block || 'wp_block' !== $reusable_block->post_type ) { |
| 24 | 22 | return ''; |
| 25 | 23 | } |
| 26 | 24 | |
| 27 | - if ( isset( $seen_refs[ $attributes['ref'] ] ) ) { | |
| 28 | - // WP_DEBUG_DISPLAY must only be honored when WP_DEBUG. This precedent | |
| 29 | - // is set in `wp_debug_mode()`. | |
| 30 | - $is_debug = defined( 'WP_DEBUG' ) && WP_DEBUG && | |
| 31 | - defined( 'WP_DEBUG_DISPLAY' ) && WP_DEBUG_DISPLAY; | |
| 32 | - | |
| 33 | - return $is_debug ? | |
| 34 | - // translators: Visible only in the front end, this warning takes the place of a faulty block. | |
| 35 | - __( '[block rendering halted]' ) : | |
| 36 | - ''; | |
| 37 | - } | |
| 38 | - | |
| 39 | 25 | if ( 'publish' !== $reusable_block->post_status || ! empty( $reusable_block->post_password ) ) { |
| 40 | 26 | return ''; |
| 41 | 27 | } |
| 42 | 28 | |
| 43 | - $seen_refs[ $attributes['ref'] ] = true; | |
| 44 | - | |
| 45 | - // Handle embeds for reusable blocks. | |
| 46 | - global $wp_embed; | |
| 47 | - $content = $wp_embed->run_shortcode( $reusable_block->post_content ); | |
| 48 | - $content = $wp_embed->autoembed( $content ); | |
| 49 | - | |
| 50 | - $content = do_blocks( $content ); | |
| 51 | - unset( $seen_refs[ $attributes['ref'] ] ); | |
| 52 | - return $content; | |
| 29 | + return do_blocks( $reusable_block->post_content ); | |
| 53 | 30 | } |
| 54 | 31 | |
| 55 | 32 | /** |
| 56 | 33 | * Registers the `core/block` block. |