PluginProbe
Gutenberg / 10.1.0
Gutenberg v10.1.0
24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 All 403 releases
← All changes | build/block-library/blocks/block.php +13 -7 12.6.0 → 10.1.0 View file →
@@ -24,8 +24,19 @@
24 24 return '';
25 25 }
26 26
27 27 if ( isset( $seen_refs[ $attributes['ref'] ] ) ) {
28 + if ( ! is_admin() ) {
29 + trigger_error(
30 + sprintf(
31 + // translators: %s is the user-provided title of the reusable block.
32 + __( 'Could not render Reusable Block <strong>%s</strong>: blocks cannot be rendered inside themselves.' ),
33 + $reusable_block->post_title
34 + ),
35 + E_USER_WARNING
36 + );
37 + }
38 +
28 39 // WP_DEBUG_DISPLAY must only be honored when WP_DEBUG. This precedent
29 40 // is set in `wp_debug_mode()`.
30 41 $is_debug = defined( 'WP_DEBUG' ) && WP_DEBUG &&
31 42 defined( 'WP_DEBUG_DISPLAY' ) && WP_DEBUG_DISPLAY;
@@ -41,16 +52,11 @@
41 52 }
42 53
43 54 $seen_refs[ $attributes['ref'] ] = true;
44 55
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 );
56 + $result = do_blocks( $reusable_block->post_content );
51 57 unset( $seen_refs[ $attributes['ref'] ] );
52 - return $content;
58 + return $result;
53 59 }
54 60
55 61 /**
56 62 * Registers the `core/block` block.