Skip to content

Commit

Permalink
Only load form files on CBT page
Browse files Browse the repository at this point in the history
  • Loading branch information
mikachan committed Nov 23, 2023
1 parent 162abfb commit 5d05271
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions admin/create-theme/theme-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
}
}
}

0 comments on commit 5d05271

Please sign in to comment.