diff --git a/Core/Providers/AssetsProvider.php b/Core/Providers/AssetsProvider.php index bd183535..0ecb09f6 100644 --- a/Core/Providers/AssetsProvider.php +++ b/Core/Providers/AssetsProvider.php @@ -390,13 +390,17 @@ public function enqueue_block_editor_assets() { foreach ( $scripts as $script_handle => $script_file ) { $build_vars = require \PF_ROOT . '/build/' . $script_file . '.asset.php'; - wp_enqueue_script( - $script_handle, - \PF_URL . '/build/' . $script_file . '.js', - $build_vars['dependencies'], - $build_vars['version'], - true - ); + // Avoid enqueuing scripts/styles on the widgets page. + $current_screen = get_current_screen(); + if ( $current_screen->id !== 'widgets' ) { + wp_enqueue_script( + $script_handle, + \PF_URL . '/build/' . $script_file . '.js', + $build_vars['dependencies'], + $build_vars['version'], + true + ); + } } wp_add_inline_script(