Skip to content

Commit

Permalink
Enable FSE blocks in FSE themes
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Oct 30, 2020
1 parent ac827d9 commit be1528e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion lib/experiments-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ function gutenberg_display_experiment_section() {
* @return array Filtered editor settings.
*/
function gutenberg_experiments_editor_settings( $settings ) {
$experiments_settings = array();
$experiments_settings = array(
'__unstableEnableFullSiteEditingBlocks' => gutenberg_is_fse_theme(),
);
$gradient_presets = current( (array) get_theme_support( 'editor-gradient-presets' ) );
if ( false !== $gradient_presets ) {
$experiments_settings['gradients'] = $gradient_presets;
Expand Down
6 changes: 3 additions & 3 deletions packages/block-library/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export const registerCoreBlocks = (
/**
* Function to register experimental core blocks depending on editor settings.
*
* @param {boolean} isSiteEditor Whether to enable site editor blocks.
* @param {boolean} enableFSEBlocks Whether to enable the full site editing blocks.
* @example
* ```js
* import { __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';
Expand All @@ -202,13 +202,13 @@ export const registerCoreBlocks = (
*/
export const __experimentalRegisterExperimentalCoreBlocks =
process.env.GUTENBERG_PHASE === 2
? ( isSiteEditor ) => {
? ( enableFSEBlocks ) => {
[
navigation,
navigationLink,

// Register Full Site Editing Blocks.
...( isSiteEditor
...( enableFSEBlocks
? [
siteLogo,
siteTagline,
Expand Down
4 changes: 3 additions & 1 deletion packages/edit-post/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ export function initializeEditor(
);
registerCoreBlocks();
if ( process.env.GUTENBERG_PHASE === 2 ) {
__experimentalRegisterExperimentalCoreBlocks();
__experimentalRegisterExperimentalCoreBlocks(
settings.__unstableEnableFullSiteEditingBlocks
);
}

// Show a console log warning if the browser is not in Standards rendering mode.
Expand Down

0 comments on commit be1528e

Please sign in to comment.