Full Site Editing - Version 3.26678

Version Description

Download this release

Release Info

Developer mattwiebe
Plugin Icon wp plugin Full Site Editing
Version 3.26678
Comparing to
See all releases

Code changes from version 3.26587 to 3.26678

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.26587
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.26587' );
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.26678
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.26678' );
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.26587
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.26678
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
@@ -100,10 +100,6 @@ function load_core_fse() {
100
  add_action( 'admin_menu', 'gutenberg_remove_legacy_pages' );
101
  add_action( 'admin_bar_menu', 'gutenberg_adminbar_items', 50 );
102
  add_action( 'admin_menu', __NAMESPACE__ . '\hide_nav_menus_submenu' );
103
-
104
- // Hides the AMP menu.
105
- remove_action( 'admin_menu', 'amp_add_customizer_link' );
106
-
107
  remove_action( 'init', __NAMESPACE__ . '\hide_template_cpts', 11 );
108
  remove_action( 'restapi_theme_init', __NAMESPACE__ . '\hide_template_cpts', 11 );
109
  remove_filter( 'block_editor_settings_all', __NAMESPACE__ . '\hide_fse_blocks' );
@@ -123,9 +119,6 @@ function unload_core_fse() {
123
  remove_action( 'admin_bar_menu', 'gutenberg_adminbar_items', 50 );
124
  remove_action( 'admin_menu', __NAMESPACE__ . '\hide_nav_menus_submenu' );
125
 
126
- // Shows the AMP menu.
127
- add_action( 'admin_menu', 'amp_add_customizer_link' );
128
-
129
  if ( defined( 'REST_API_REQUEST' ) && true === REST_API_REQUEST ) {
130
  // Do not hook to init during the REST API requests, as it causes PHP warnings
131
  // while loading the alloptions (unable to access wp_0_ prefixed tables).
@@ -150,13 +143,8 @@ function load_helpers() {
150
  return;
151
  }
152
 
153
- // AMP registration on the default 10 priority is too early and confuses the current
154
- // Gutenberg (v12.5.1 at this comment's writing) `gutenberg_remove_legacy_pages` function
155
- // into mistaking it for the Customizer proper.
156
- if ( function_exists( 'amp_add_customizer_link' ) ) {
157
- remove_action( 'admin_menu', 'amp_add_customizer_link' );
158
- add_action( 'admin_menu', 'amp_add_customizer_link', 11 );
159
- }
160
 
161
  if ( apply_filters( 'a8c_hide_core_fse_activation', false ) ) {
162
  return;
@@ -180,6 +168,24 @@ function unload_helpers() {
180
  remove_action( 'admin_notices', __NAMESPACE__ . '\theme_nag' );
181
  remove_action( 'admin_menu', __NAMESPACE__ . '\add_submenu' );
182
  remove_action( 'admin_init', __NAMESPACE__ . '\init_settings' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  }
184
 
185
  /**
100
  add_action( 'admin_menu', 'gutenberg_remove_legacy_pages' );
101
  add_action( 'admin_bar_menu', 'gutenberg_adminbar_items', 50 );
102
  add_action( 'admin_menu', __NAMESPACE__ . '\hide_nav_menus_submenu' );
 
 
 
 
103
  remove_action( 'init', __NAMESPACE__ . '\hide_template_cpts', 11 );
104
  remove_action( 'restapi_theme_init', __NAMESPACE__ . '\hide_template_cpts', 11 );
105
  remove_filter( 'block_editor_settings_all', __NAMESPACE__ . '\hide_fse_blocks' );
119
  remove_action( 'admin_bar_menu', 'gutenberg_adminbar_items', 50 );
120
  remove_action( 'admin_menu', __NAMESPACE__ . '\hide_nav_menus_submenu' );
121
 
 
 
 
122
  if ( defined( 'REST_API_REQUEST' ) && true === REST_API_REQUEST ) {
123
  // Do not hook to init during the REST API requests, as it causes PHP warnings
124
  // while loading the alloptions (unable to access wp_0_ prefixed tables).
143
  return;
144
  }
145
 
146
+ // Amp plugin helper.
147
+ add_action( 'admin_menu', __NAMESPACE__ . '\maybe_juggle_amp_priority', 0 );
 
 
 
 
 
148
 
149
  if ( apply_filters( 'a8c_hide_core_fse_activation', false ) ) {
150
  return;
168
  remove_action( 'admin_notices', __NAMESPACE__ . '\theme_nag' );
169
  remove_action( 'admin_menu', __NAMESPACE__ . '\add_submenu' );
170
  remove_action( 'admin_init', __NAMESPACE__ . '\init_settings' );
171
+ remove_action( 'admin_menu', __NAMESPACE__ . '\maybe_juggle_amp_priority', 0 );
172
+ }
173
+
174
+ /**
175
+ * AMP registration on the default 10 priority is too early and confuses the current Gutenberg
176
+ * plugin's `gutenberg_remove_legacy_pages` function into mistaking it for the Customizer proper.
177
+ *
178
+ * This will be fixed once https://github.com/WordPress/gutenberg/pull/38598 is released.
179
+ *
180
+ * @return void
181
+ */
182
+ function maybe_juggle_amp_priority() {
183
+ if ( ! function_exists( 'amp_add_customizer_link' ) || ! has_action( 'admin_menu', 'amp_add_customizer_link' ) ) {
184
+ return;
185
+ }
186
+
187
+ remove_action( 'admin_menu', 'amp_add_customizer_link' );
188
+ add_action( 'admin_menu', 'amp_add_customizer_link', 11 );
189
  }
190
 
191
  /**