Skip to content

Commit 557a85a

Browse files
authored
Blocks: allow enabling Experimental blocks via a filter (#14908)
Follow-up from #14104. In some environments (like on WordPress.com), it may be easier to use a filter to change the way we load blocks.
1 parent 240f1b5 commit 557a85a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

class.jetpack-gutenberg.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,17 @@ public static function init() {
313313
Constants::set_constant( 'JETPACK_BETA_BLOCKS', true );
314314
}
315315

316+
/**
317+
* Alternative to `JETPACK_EXPERIMENTAL_BLOCKS`, set to `true` to load Experimental Blocks.
318+
*
319+
* @since 8.4.0
320+
*
321+
* @param boolean
322+
*/
323+
if ( apply_filters( 'jetpack_load_experimental_blocks', false ) ) {
324+
Constants::set_constant( 'JETPACK_EXPERIMENTAL_BLOCKS', true );
325+
}
326+
316327
/**
317328
* Filter the whitelist of block editor extensions that are available through Jetpack.
318329
*

0 commit comments

Comments
 (0)