Skip to content

Commit

Permalink
Set ALLOW_EXPERIMENT_REREGISTRATION to false in WebPack build.
Browse files Browse the repository at this point in the history
Gutenberg introduced a system of sharing private APIs in
WordPress/gutenberg#46131. One of the
safeguards is a check preventing the same module from opting-in
twice so that contributors cannot easily gain access by pretending
to be a core module.

That safeguard is only meant for WordPress core and not for
the released `@wordpress` packages. However, right now it is
opt-out and must be explicitly disabled by developers wanting to
install the `@wordpress` packages. Let's make it opt-out instead.

This commit opts-out from that check in WordPress core by setting
the ALLOW_EXPERIMENT_REREGISTRATION to false. Once it's merged,
the Gutenberg plugin should be adjusted to use `true` as the
default value.
  • Loading branch information
adamziel committed Feb 23, 2023
1 parent f80dfdf commit 8761517
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wp-includes/blocks/template-part.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function render_block_core_template_part( $attributes ) {
if (
isset( $attributes['slug'] ) &&
isset( $attributes['theme'] ) &&
get_stylesheet() === $attributes['theme']
wp_get_theme()->get_stylesheet() === $attributes['theme']
) {
$template_part_id = $attributes['theme'] . '//' . $attributes['slug'];
$template_part_query = new WP_Query(
Expand Down

0 comments on commit 8761517

Please sign in to comment.