Hello Forum,
I have a plugin that needs mootools to be included in the head section of the plugin admin pages. To avoid problems with the jQuery framework used by Wordpresss I only want to include the mootools script on the respective plugin admin pages.
I'm using the "admin_menu" hook but with no success. I've red in the codex there's a way to do that for specific admin pages only but I'm experiencing some difficulties.
I'm doing something like this in my plugin file:
function mootools(){
$url = get_settings('siteurl');
echo '<script type="text/javascript" src="'.$url.'/wp-content/plugins/myplugin/mootools.v1.11.js"></script>'."\n";
}
add_action('admin_head-????', 'mootools');
???? this is where I'm getting confused. What should I put here?
I don't know if it has anything to do with it but this is the way I'm creating the admin buttons/pages for my plugin:
function myplugin_add_admin_pages(){
add_menu_page('Lojas', 'Lojas', 8, __FILE__, 'pluginname_overview');
add_submenu_page(__FILE__, 'LojasAdicionar', 'Adicionar', 8, 'subpage1', 'pluginname_view');
add_submenu_page(__FILE__, 'LojasApagar', 'Apaagr', 8, 'subpage2', 'pluginname_add');
}
add_action('admin_menu', 'myplugin_add_admin_pages');
Help appreciated. Thanks. (using WP 2.2.1)