I have a WordPress plugin, and I must load scripts from my plugin to the front of the site.
class My_Plugin {
function __construct()
{
add_action('admin_menu', array(&$this, 'add_submenu'));
add_action('admin_init', array(&$this, 'admin_init'))
}
function load_my_scripts(){
wp_enqueue_script('script', 'js/myscript.js');
}
I would like to load my script, so using the right hook which will be able to add the script into all the page of the site.
I've already tried with
add_action('wp_head', array(&$this, 'load_my_scripts'));
add_action('init', array(&$this, 'load_my_scripts'));
etc, ... but I don't find any solution... Could you help me please ?