{"id":13961973,"date":"2021-01-27T01:39:24","date_gmt":"2021-01-27T01:39:24","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/admin-php-flow\/"},"modified":"2021-01-27T01:39:24","modified_gmt":"2021-01-27T01:39:24","slug":"admin-php-flow","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/admin-php-flow\/","title":{"rendered":"admin.php flow"},"content":{"rendered":"<p>Hi, <\/p>\n<p>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: <\/p>\n<p><strong>Screenshot of the program flow in question:<\/strong> <a href=\"https:\/\/prnt.sc\/xohtiz\" rel=\"noopener\" target=\"_blank\">https:\/\/prnt.sc\/xohtiz<\/a><\/p>\n<p>(Q1) I was wondering how do_action( &#8220;load-{$plugin_page}&#8221; ) gets triggered. Or rather, does add_menu_page &#8220;call&#8221; load-{$plugin_page} apart from load-{$page_hook}?<\/p>\n<p>Screenshot of code: <a href=\"https:\/\/prntscr.com\/xoj8mh\" rel=\"noopener\" target=\"_blank\">https:\/\/prntscr.com\/xoj8mh<\/a><\/p>\n<p>(Q2) Is there any use case in the core that I could look at for this hook: do_action( &#8220;admin_action_{$action}&#8221; );<\/p>\n<p>Screenshot of code: <a href=\"https:\/\/prntscr.com\/xoj7g9\" rel=\"noopener\" target=\"_blank\">https:\/\/prntscr.com\/xoj7g9<\/a><\/p>\n<p>The questions above aren&#8217;t for a specific project as such. This is a &#8220;back to basics&#8221; 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. <\/p>\n<p>Thanks in advance. <\/p>\n<p>Cheers.<br \/>\nM <\/p>\n","protected":false},"template":"","class_list":["post-13961973","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/13961973","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/13961973\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=13961973"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}