diff --git a/admin/create-theme/theme-form.php b/admin/create-theme/theme-form.php index c1b0ec80..be4e3796 100644 --- a/admin/create-theme/theme-form.php +++ b/admin/create-theme/theme-form.php @@ -276,10 +276,12 @@ public static function create_admin_form_page() { } public static function form_script() { - wp_enqueue_script( 'form-script', plugin_dir_url( dirname( __FILE__ ) ) . 'js/form-script.js' ); - wp_enqueue_style( 'form-style', plugin_dir_url( dirname( __FILE__ ) ) . 'css/form.css' ); + if ( ! empty( $_GET['page'] ) && 'create-block-theme' === $_GET['page'] ) { + wp_enqueue_script( 'form-script', plugin_dir_url( dirname( __FILE__ ) ) . 'js/form-script.js' ); + wp_enqueue_style( 'form-style', plugin_dir_url( dirname( __FILE__ ) ) . 'css/form.css' ); - // Enable localization in the form. - wp_set_script_translations( 'form-script', 'create-block-theme' ); + // Enable localization in the form. + wp_set_script_translations( 'form-script', 'create-block-theme' ); + } } }