1

I saw the excellent answer (link below) but would like to learn for myself how to look for action call of a specific plugin so i can stop it using the idea of EAMan Restricting a Plugin to Only Load its CSS and JS on Selected Pages?

I have used http://wordpress.org/extend/plugins/datapress/ and its js/css is only needed on one page.

Same for other plugins. How do I go about finding out what function those plugins call so I can enabled it on only pages needed.

  • If the plugin is still actively developed, report your problem back to the plugin author as well please. – hakre Feb 13 '11 at 10:52
  • Yes, I did let the author know about it. – Andy Nguyen Feb 13 '11 at 13:17
2

is_admin() is useful for the front end.

The load-$pagenow hook and a few others are useful on the backend. wp-admin/admin-header.php, for instance, contains:

do_action('admin_enqueue_scripts', $hook_suffix);
do_action("admin_print_styles-$hook_suffix");
do_action('admin_print_styles');
do_action("admin_print_scripts-$hook_suffix");
do_action('admin_print_scripts');
do_action("admin_head-$hook_suffix");
do_action('admin_head');

Note the $hook_suffix variable, which you can var_dump() then and there to know what its value is when your plugin's page is being loaded.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.