Repository navigation
Navigation overlay: remove experiment #74968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
8f062b3
45b8618
f9423e4
771df71
018054c
ca2222c
5b659ef
0e54cc1
67c4ca7
ac69b5e
31e061e
ee4bc69
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| https://github.com/WordPress/wordpress-develop/pull/10844 | ||
|
|
||
| * https://github.com/WordPress/gutenberg/pull/74968 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,23 +8,27 @@ | |
| /** | ||
| * Registers block patterns for navigation overlays. | ||
| * | ||
| * This function adds patterns that are specific to the navigation overlays | ||
| * experiment. It runs after core patterns are registered to ensure all patterns | ||
| * This function adds patterns that are specific to navigation overlays. | ||
| * It runs after core patterns are registered to ensure all patterns | ||
| * are available. | ||
| * | ||
| * @since 6.0.0 | ||
| */ | ||
| function gutenberg_register_overlay_block_patterns() { | ||
| register_block_pattern_category( | ||
| 'navigation', | ||
| array( | ||
| 'label' => _x( 'Navigation', 'Block pattern category', 'gutenberg' ), | ||
| 'description' => _x( 'Display your website navigation.', 'Block pattern category', 'gutenberg' ), | ||
| ) | ||
| ); | ||
| // Register category only if it doesn't exist in core. | ||
| $category_registry = WP_Block_Pattern_Categories_Registry::get_instance(); | ||
| if ( ! $category_registry->is_registered( 'navigation' ) ) { | ||
| register_block_pattern_category( | ||
| 'navigation', | ||
| array( | ||
| 'label' => _x( 'Navigation', 'Block pattern category', 'gutenberg' ), | ||
| 'description' => _x( 'Display your website navigation.', 'Block pattern category', 'gutenberg' ), | ||
| ) | ||
| ); | ||
| } | ||
|
|
||
| register_block_pattern( | ||
| 'gutenberg/navigation-overlay', | ||
| 'core/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' ), | ||
|
|
@@ -37,11 +41,12 @@ function gutenberg_register_overlay_block_patterns() { | |
| <!-- /wp:group -->', | ||
| 'categories' => array( 'navigation' ), | ||
| 'blockTypes' => array( 'core/template-part/navigation-overlay' ), | ||
| 'source' => 'core', | ||
| ) | ||
| ); | ||
|
|
||
| register_block_pattern( | ||
| 'gutenberg/navigation-overlay-black-bg', | ||
| 'core/navigation-overlay-black-bg', | ||
| array( | ||
| 'title' => __( 'Overlay with black background', 'gutenberg' ), | ||
| 'description' => _x( 'A navigation overlay with black background and big white text', 'Block pattern description', 'gutenberg' ), | ||
|
|
@@ -54,10 +59,11 @@ function gutenberg_register_overlay_block_patterns() { | |
| <!-- /wp:group -->', | ||
| 'categories' => array( 'navigation' ), | ||
| 'blockTypes' => array( 'core/template-part/navigation-overlay' ), | ||
| 'source' => 'gutenberg/navigation-overlay', | ||
| ) | ||
| ); | ||
| register_block_pattern( | ||
| 'gutenberg/navigation-overlay-accent-bg', | ||
| 'core/navigation-overlay-accent-bg', | ||
| array( | ||
| 'title' => __( 'Overlay with orange background', 'gutenberg' ), | ||
| 'description' => _x( 'A navigation overlay with orange background site title and tagline', 'Block pattern description', 'gutenberg' ), | ||
|
|
@@ -80,10 +86,11 @@ function gutenberg_register_overlay_block_patterns() { | |
| <!-- /wp:group -->', | ||
| 'categories' => array( 'navigation' ), | ||
| 'blockTypes' => array( 'core/template-part/navigation-overlay' ), | ||
| 'source' => 'core', | ||
| ) | ||
| ); | ||
| register_block_pattern( | ||
| 'gutenberg/navigation-overlay-centered-with-extras', | ||
| 'core/navigation-overlay-centered-with-extras', | ||
| array( | ||
| 'title' => __( 'Overlay with site info and CTA', 'gutenberg' ), | ||
| 'description' => _x( 'A navigation overlay with vertically and horizontally centered navigation, site info, and a CTA', 'Block pattern description', 'gutenberg' ), | ||
|
|
@@ -122,10 +129,11 @@ function gutenberg_register_overlay_block_patterns() { | |
| <!-- /wp:group -->', | ||
| 'categories' => array( 'navigation' ), | ||
| 'blockTypes' => array( 'core/template-part/navigation-overlay' ), | ||
| 'source' => 'core', | ||
| ) | ||
| ); | ||
| register_block_pattern( | ||
| 'gutenberg/navigation-overlay-centered', | ||
| 'core/navigation-overlay-centered', | ||
| array( | ||
| 'title' => __( 'Overlay with centered navigation', 'gutenberg' ), | ||
| 'description' => _x( 'A navigation overlay with vertically and horizontally centered navigation', 'Block pattern description', 'gutenberg' ), | ||
|
|
@@ -140,6 +148,7 @@ function gutenberg_register_overlay_block_patterns() { | |
| <!-- /wp:group -->', | ||
| 'categories' => array( 'navigation' ), | ||
| 'blockTypes' => array( 'core/template-part/navigation-overlay' ), | ||
| 'source' => 'core', | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this adds them to |
||
| ) | ||
| ); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my only concern here is the naming of the patterns, the default one in particular. @getdave we don't have much precedent for using patterns like we do when we insert this one on overlay creation, you asked me on another PR about the naming convention with
core/vsgutenberg/. Historically we have created and tested new core patterns in gutenberg, with the gutenberg namespace, and then on backport we have renamed them to core, and right after merging we delete them from gutenberg because they would be duplicated otherwise. But we've never had an instance that I know of where a core pattern is invoked by gutenberg. I think there's two ways to go about this:What do you think? This is the moment to make this decision
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it's possible to construct a conditional that's if Gutenberg Plugin and version is less than 7.0 then use
gutenbergelse usecore? Then when a production build is compiled it would resolve tofalse.I'm leaning towards option 2 though.
I'm keen to get a wider range of perspectives @scruffian @jeryj @mikachan @tyxla
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason not to go with option 2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 sounds good to me. I'd just double-check the scenario with name conflicts with core registering the patterns and GB registering them too. The way I see it, the GB ones should take precedence, and if that's the case, then we're good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for chiming in! I'll make that check and push the change