If you’re developing a WordPress plugin and wondering how to load Javascript in your plugin, I’ve found an example below.
There is a hook called , which should be used in place of wp_enqueue_scriptsinit for loading scripts.
<?php
add_action('wp_enqueue_scripts','ava_test_init');
function ava_test_init() {
wp_enqueue_script( 'ava-test-js', plugins_url( '/js/ava_test_.js', __FILE__ ));
}

Share Your Thoughts