diff --git a/lib/experimental/overlay-patterns.php b/lib/experimental/overlay-patterns.php new file mode 100644 index 00000000000000..0cfb4cbab84d1c --- /dev/null +++ b/lib/experimental/overlay-patterns.php @@ -0,0 +1,46 @@ + _x( 'Navigation', 'Block pattern category', 'gutenberg' ), + 'description' => _x( 'Display your website navigation.', 'Block pattern category', 'gutenberg' ), + ) + ); + + register_block_pattern( + 'gutenberg/navigation-overlay', + array( + 'title' => __( 'Navigation Overlay', 'gutenberg' ), + 'description' => _x( 'A simple pattern with a navigation block and a navigation overlay close button.', 'Block pattern description', 'gutenberg' ), + 'content' => ' +
+
+ +
+ + +
+', + 'categories' => array( 'navigation' ), + 'blockTypes' => array( 'core/template-part/overlay' ), + ) + ); +} + +add_action( 'init', 'gutenberg_register_overlay_block_patterns', 20 ); diff --git a/lib/load.php b/lib/load.php index 7eb1dfb78a86a0..5ed2a09a1c1357 100644 --- a/lib/load.php +++ b/lib/load.php @@ -211,3 +211,8 @@ function gutenberg_is_experiment_enabled( $name ) { require __DIR__ . '/experimental/interactivity-api/class-gutenberg-interactivity-api-full-page-navigation.php'; Gutenberg_Interactivity_API_Full_Page_Navigation::instance(); } + +// Block patterns (only load when navigation overlays experiment is enabled). +if ( gutenberg_is_experiment_enabled( 'gutenberg-customizable-navigation-overlays' ) ) { + require __DIR__ . '/experimental/overlay-patterns.php'; +}