Full Site Editing - Version 3.22866

Version Description

Download this release

Release Info

Developer automattic
Plugin Icon wp plugin Full Site Editing
Version 3.22866
Comparing to
See all releases

Code changes from version 3.22835 to 3.22866

full-site-editing-plugin.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: WordPress.com Editing Toolkit
4
  * Description: Enhances your page creation workflow within the Block Editor.
5
- * Version: 3.22835
6
  * Author: Automattic
7
  * Author URI: https://automattic.com/wordpress-plugins/
8
  * License: GPLv2 or later
@@ -42,7 +42,7 @@ namespace A8C\FSE;
42
  *
43
  * @var string
44
  */
45
- define( 'A8C_ETK_PLUGIN_VERSION', '3.22835' );
46
 
47
  // Always include these helper files for dotcom FSE.
48
  require_once __DIR__ . '/dotcom-fse/helpers.php';
2
  /**
3
  * Plugin Name: WordPress.com Editing Toolkit
4
  * Description: Enhances your page creation workflow within the Block Editor.
5
+ * Version: 3.22866
6
  * Author: Automattic
7
  * Author URI: https://automattic.com/wordpress-plugins/
8
  * License: GPLv2 or later
42
  *
43
  * @var string
44
  */
45
+ define( 'A8C_ETK_PLUGIN_VERSION', '3.22866' );
46
 
47
  // Always include these helper files for dotcom FSE.
48
  require_once __DIR__ . '/dotcom-fse/helpers.php';
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: automattic
3
  Tags: block, blocks, editor, gutenberg, page
4
  Requires at least: 5.5
5
  Tested up to: 5.6
6
- Stable tag: 3.22835
7
  Requires PHP: 5.6.20
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
3
  Tags: block, blocks, editor, gutenberg, page
4
  Requires at least: 5.5
5
  Tested up to: 5.6
6
+ Stable tag: 3.22866
7
  Requires PHP: 5.6.20
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
wpcom-universal-themes/index.php CHANGED
@@ -26,8 +26,15 @@ function is_core_fse_active() {
26
  return false;
27
  }
28
 
29
- // Now we just check for our own option.
30
- return (bool) get_option( ACTIVATE_FSE_OPTION_NAME );
 
 
 
 
 
 
 
31
  }
32
 
33
  /**
@@ -41,6 +48,17 @@ function is_fse_theme() {
41
  return function_exists( 'gutenberg_is_fse_theme' ) && gutenberg_is_fse_theme();
42
  }
43
 
 
 
 
 
 
 
 
 
 
 
 
44
  /**
45
  * Activates Core FSE by setting our option.
46
  * Note that even setting this option to true will make no difference on a classic theme.
@@ -113,8 +131,13 @@ function load_helpers() {
113
  if ( apply_filters( 'a8c_hide_core_fse_activation', false ) ) {
114
  return;
115
  }
 
 
 
 
 
 
116
  add_action( 'admin_notices', __NAMESPACE__ . '\theme_nag' );
117
- add_action( 'admin_menu', __NAMESPACE__ . '\add_submenu' );
118
  add_action( 'admin_init', __NAMESPACE__ . '\init_settings' );
119
  }
120
 
26
  return false;
27
  }
28
 
29
+ if ( is_universal_theme() ) {
30
+ return (bool) get_option( ACTIVATE_FSE_OPTION_NAME );
31
+ }
32
+
33
+ // Universal themes can use the customizer to customize the site, regardless of whether or
34
+ // not the full site editor is activated. Block themes, however, don't have access to the
35
+ // customizer. If the site editor is disabled for them, it will severely limit site
36
+ // customizability. Because of this we always activate FSE for block themes.
37
+ return true;
38
  }
39
 
40
  /**
48
  return function_exists( 'gutenberg_is_fse_theme' ) && gutenberg_is_fse_theme();
49
  }
50
 
51
+ /**
52
+ * To identify universal themes, we assume that child themes will
53
+ * all use blockbase as their default theme template. This
54
+ * function checks if the current template is a blockbase template.
55
+ *
56
+ * @return boolean
57
+ */
58
+ function is_universal_theme() {
59
+ return 'blockbase' === basename( get_template() );
60
+ }
61
+
62
  /**
63
  * Activates Core FSE by setting our option.
64
  * Note that even setting this option to true will make no difference on a classic theme.
131
  if ( apply_filters( 'a8c_hide_core_fse_activation', false ) ) {
132
  return;
133
  }
134
+ // This menu toggles site editor visibility for universal themes.
135
+ // It's unnecessary for block themes because the site editor
136
+ // will always be visible.
137
+ if ( is_universal_theme() ) {
138
+ add_action( 'admin_menu', __NAMESPACE__ . '\add_submenu' );
139
+ }
140
  add_action( 'admin_notices', __NAMESPACE__ . '\theme_nag' );
 
141
  add_action( 'admin_init', __NAMESPACE__ . '\init_settings' );
142
  }
143