load-<pagenow>
Fires before a particular screen is loaded.
Description
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'.
Usage
- To run the hook, copy the example below.
- // run the action
- do_action( 'load-{$pagenow}' );
- The following example is for adding a hook callback.
- // define the load-<pagenow> callback
- function action_load_pagenow( ) {
- // make action magic happen here...
- };
- // add the action
- add_action( "load-{$pagenow}", 'action_load_pagenow', 10, 0 );
- To remove a hook callback, use the example below.
- // remove the action
- remove_action( "load-{$pagenow}", 'action_load_pagenow', 10, 0 );
Defined (1)
The action is defined in the following location(s).
- /wp-admin/admin.php
- do_action( "load-{$pagenow}" );