WP: add action to plugin specific page

/ Published in: PHP
Save to your folder(s)

Ensures the admin scripts or styles will load only on your wordpress plugin settings page:

- add_options_page returns a hook_suffix for the settings page of your plugin.
- append this value prefixed with a dash (-) to the end of the action you are adding to

Copy this code and paste it in your HTML
  1. /*
  3. add_action('[action name]-[value returned by add_options_page'], array(&$this, '[function name]');
  4. */
  6. add_action('admin_print_scripts-settings_page_SlideThatBanner', array(&$this,'add_admin_js'));

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.