Title: admin.php flow
Last modified: January 27, 2021

---

# admin.php flow

 *  [mysticalcode](https://wordpress.org/support/users/mysticalcode/)
 * (@mysticalcode)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/admin-php-flow/)
 * Hi,
 * I thought of understanding better the nuts and bolts of WordPress core program
   during this slack period by reading the code and drawing a general flowchart 
   for my own purpose. I have a few questions though:
 * **Screenshot of the program flow in question:** [https://prnt.sc/xohtiz](https://prnt.sc/xohtiz)
 * (Q1) I was wondering how do_action( “load-{$plugin_page}” ) gets triggered. Or
   rather, does add_menu_page “call” load-{$plugin_page} apart from load-{$page_hook}?
 * Screenshot of code: [https://prntscr.com/xoj8mh](https://prntscr.com/xoj8mh)
 * (Q2) Is there any use case in the core that I could look at for this hook: do_action(“
   admin_action_{$action}” );
 * Screenshot of code: [https://prntscr.com/xoj7g9](https://prntscr.com/xoj7g9)
 * The questions above aren’t for a specific project as such. This is a “back to
   basics” exercise in order for me to better structure plugins etc. Equally important,
   it will make me better diagnose issues that may come up with sites I maintain.
 * Thanks in advance.
 * Cheers.
    M

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/admin-php-flow/#post-13966743)
 * “load-{$plugin_page}” fires when a plugin’s admin page is loaded. There are likely
   no callbacks added since WP loads the admin page anyway. The action is there 
   for plugin developer use if they need to execute code before a plugin’s admin
   page is loaded. This way someone could influence one plugin’s behavior from another
   plugin, provided they know the right page ID.
 * The “load-$something” format is applied in other contexts besides plugin admin
   pages. It all depends on what value is passed for $something. It generally fires
   just before some PHP file is required or included.
 * Similarly, “admin_action_{$action}” likely has no added callbacks, but it’s there
   for developer use should they see a need. In this case it fires on any admin 
   request that includes an “action” value in any of the request super globals. 
   An action value is commonly passed when requesting admin-ajax.php, but in that
   case a more specific action hook is most commonly used.
 *  Thread Starter [mysticalcode](https://wordpress.org/support/users/mysticalcode/)
 * (@mysticalcode)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/admin-php-flow/#post-13967977)
 * Thanks, [@bcworkz](https://wordpress.org/support/users/bcworkz/),
 * > “load-{$plugin_page}” fires when a plugin’s admin page is loaded. There are
   > likely no callbacks added since WP loads the admin page anyway. The action 
   > is there for plugin developer use if they need to execute code before a plugin’s
   > admin page is loaded. This way someone could influence one plugin’s behaviour
   > from another plugin, provided they know the right page ID.
 * I guess I got fixated with menu structures where a plugin’s admin pages are called.
   I’ll do some experimentation to understand it better. This one is particularly
   interesting as well:
 * > The “load-$something” format is applied in other contexts besides plugin admin
   > pages. It all depends on what value is passed for $something. It generally 
   > fires just before some PHP file is required or included.
 * I’ll have a play with “admin_action_{$action}” as well.
 * Again, thank you. I hope you’re well.
 * Cheers,
    M

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘admin.php flow’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 2 participants
 * Last reply from: [mysticalcode](https://wordpress.org/support/users/mysticalcode/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/admin-php-flow/#post-13967977)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
