Skip to content

Commit

Permalink
Use an experimental flag
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Apr 6, 2023
1 parent 172d6cf commit 8cb81b7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/experimental/editor-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ function gutenberg_enable_experiments() {
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-color-randomizer', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableColorRandomizer = true', 'before' );
}
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-command-center', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-edit-site', 'window.__experimentalEnableCommandCenter = true', 'before' );
}
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-group-grid-variation', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableGroupGridVariation = true', 'before' );
}
Expand Down
12 changes: 12 additions & 0 deletions lib/experiments-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,18 @@ function gutenberg_initialize_experiments_settings() {
)
);

add_settings_field(
'gutenberg-command-center',
__( 'Command center ', 'gutenberg' ),
'gutenberg_display_experiment_field',
'gutenberg-experiments',
'gutenberg_experiments_section',
array(
'label' => __( 'Test the command center; Open it using cmd + k in the site editor.', 'gutenberg' ),
'id' => 'gutenberg-command-center',
)
);

add_settings_field(
'gutenberg-group-grid-variation',
__( 'Grid variation for Group block ', 'gutenberg' ),
Expand Down
2 changes: 1 addition & 1 deletion packages/edit-site/src/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export default function Layout() {

return (
<>
<CommandMenu />
{ window?.__experimentalEnableCommandCenter && <CommandMenu /> }
<KeyboardShortcutsRegister />
<KeyboardShortcutsGlobal />
{ fullResizer }
Expand Down

0 comments on commit 8cb81b7

Please sign in to comment.