Fires before a particular screen is loaded.


do_action( 'load-<pagenow>' ); 

The load-* hook fires in a number of contexts. This hook is for core screens.

The dynamic portion(s) of the hook name refer is a global variable referring to the filename of the current page, such as admin.php,, 'post-new.php' etc. A complete hook for the latter would be 'load-post-new.php'.


To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'load-{$pagenow}' ); 
The following example is for adding a hook callback.
  1. // define the load-<pagenow> callback 
  2. function action_load_pagenow( ) { 
  3. // make action magic happen here... 
  4. }; 
  6. // add the action 
  7. add_action( "load-{$pagenow}", 'action_load_pagenow', 10, 0 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( "load-{$pagenow}", 'action_load_pagenow', 10, 0 ); 

Defined (1)

The action is defined in the following location(s).

  1. do_action( "load-{$pagenow}" );