Skip to content

Commit

Permalink
Ensure gutenberg assets are enqueued only when needed (#36983)
Browse files Browse the repository at this point in the history
  • Loading branch information
heavyweight authored Apr 19, 2024
1 parent 18edd35 commit aa97351
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fix enqueuing editor styles
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,17 @@ public function remove_strict_kses_filters() {

/**
* Enqueue the assets for the Gutenberg editor
*
* In case the page is singular and has comment closed or front page with comments closed we avoid the enqueueing
*/
public function enqueue_assets() {
if (
! ( is_singular() && comments_open() )
&& ! ( is_front_page() && is_page() && comments_open() )
) {
return;
}

$vbe_cache_buster = filemtime( ABSPATH . '/widgets.wp.com/verbum-block-editor/build_meta.json' );

wp_enqueue_style(
Expand Down

0 comments on commit aa97351

Please sign in to comment.