diff --git a/projects/packages/jetpack-mu-wpcom/changelog/fix-verbum-style-enqueue b/projects/packages/jetpack-mu-wpcom/changelog/fix-verbum-style-enqueue new file mode 100644 index 0000000000000..727cedcb39d8c --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/changelog/fix-verbum-style-enqueue @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Fix enqueuing editor styles diff --git a/projects/packages/jetpack-mu-wpcom/src/features/verbum-comments/assets/class-verbum-gutenberg-editor.php b/projects/packages/jetpack-mu-wpcom/src/features/verbum-comments/assets/class-verbum-gutenberg-editor.php index 6a9ac17801cc2..c177984a4b819 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/verbum-comments/assets/class-verbum-gutenberg-editor.php +++ b/projects/packages/jetpack-mu-wpcom/src/features/verbum-comments/assets/class-verbum-gutenberg-editor.php @@ -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(