Enqueue Custom script in the Wordpress Customizer

Viewed 369

Is there a way to wp_enqueue_script() and use it inside the Customizer Panel in Wordpress? Something like :

function myTheme_enqueue_script_admin() {
    wp_enqueue_script( 'custom-admin-js', get_template_directory_uri() . '/js/admin.min.js', array(), '1.0', true );
}
add_action('--ENQUEUE SCRIPT TO CUSTOMIZER--', 'myTheme_enqueue_script_admin');

Thank you!

1 Answers

yes, just use this hook

add_action( 'admin_enqueue_scripts', 'func' );

read more from codex

Related