Posted By

relish on 07/13/11


wordpress plugindevelopment

Versions (?)

WP: add action to plugin specific page

 / Published in: PHP

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

  • addoptionspage 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
  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  

You need to login to post a comment.