Skip to content

Commit

Permalink
WordPress.com Block Editor: do not use in the upcoming Block-based Wi…
Browse files Browse the repository at this point in the history
…dgets Editor (#20358)

Fixes #20357

Since the WordPress.com Block editor relies on wp-editor, and since that dependency cannot be used in the widget editor (see https://core.trac.wordpress.org/changeset/51393 ), let's not load the WordPress.com editor scripts in the widget editor.
  • Loading branch information
jeherve authored Jul 14, 2021
1 parent 8fce207 commit b40a137
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: bugfix

WordPress.com Block Editor: do not use in the upcoming Block-based Widgets Editor
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,13 @@ public function filter_salt( $salt, $scheme ) {
* Enqueues the WordPress.com block editor integration assets for the editor.
*/
public function enqueue_block_editor_assets() {
global $pagenow;

// Bail if we're not in the post editor, but on the widget settings screen.
if ( is_customize_preview() || 'widgets.php' === $pagenow ) {
return;
}

$debug = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG;
$version = gmdate( 'Ymd' );

Expand Down

0 comments on commit b40a137

Please sign in to comment.