I'm having trouble with plugins lately and especially wp_print_scripts. My problem is not with actual javascript code but rather if / when is the hook actually active. After several attempts I decide to test if wp_print_scripts hooks the right way.
// Sample test add_action('wp_print_scripts', 'JustATest');
function JustATest() { echo 'It works'; exit; }
Once my plugin is enabled, everything should come to a halt when this line is processed. My administration panel disappears and prints that message when I click around in it … but my public pages (home.php, single.php, etc …) don't. They always show up. Seems there's something in there that doesn't affect that hook at all, although other filters with add_filters() work fine.
Vladimir’s WordPress Forum
A question about add_action()
13:29
30 May, 2009
marcthenarc
Post edited 21:18 – 30 May, 2009 by marcthenarc
I'm having trouble with plugins lately and especially wp_print_scripts. My problem is not with actual javascript code but rather if / when is the hook actually active. After several attempts I decide to test if wp_print_scripts hooks the right way.
add_action('wp_print_scripts', 'JustATest');
function JustATest()
{
echo 'It works'; exit;
}
Once my plugin is enabled, everything should come to a halt when this line is processed. My administration panel disappears and prints that message when I click around in it … but my public pages (home.php, single.php, etc …) don't. They always show up. Seems there's something in there that doesn't affect that hook at all, although other filters with add_filters() work fine.
I'm stumped.
[RESOLVED] – No one told me about :(