Frank, notice that I’m using the wp_enqueue_scripts
action to enqueue the script and that runs only on the front-end. Here is the description of that function:
Allows plugins to queue scripts for the front end using
wp_enqueue_script()
. Runs first inwp_head()
where allis_home()
,is_page()
, etc. functions are available.