Ready to get started?Download WordPress


Plugin API/Action Reference/admin head-(plugin page)


admin_head-(plugin_page) is triggered within the <head></head> section of a specific plugin-generated page.

This hook provides no parameters. You use this hook by having your function echo output to the browser, or by having it perform background tasks. Your functions shouldn't return, and shouldn't take any parameters.

This hook is an action which means that it primarily acts as an event trigger, instead of a content filter. This is a semantic difference, but it will help you to remember what this hook does if you use it like this:

add_action( 'admin_menu', 'myplugin_setup_options' );

function myplugin_setup_options(){
  $plugin_page=add_options_page( 'My Plugin', 'myplugin', 8, basename(__FILE__), 'myplugin_main' );
  add_action( 'admin_head-'. $plugin_page, 'myplugin_admin_header' );

function myplugin_admin_header(){
  echo '<p>Only executes when the myplugin options page is displayed.</p>';

This page is marked as incomplete. You can help Codex by expanding it.