1

I've created a page using add_theme_page with the name of access_page. Whenever someone accesses that page, or rather, for that page, a few hooks are created, such as admin-head-access_page and load-access_page.

Are these hooks guaranteed to be consistent everywhere, on every install?

2
  • Why wouldn’t they be? Feb 10, 2019 at 3:48
  • @JacobPeattie I understand this could be a stupid question, but I was working with the rest_url and that changes depending on your "reading" settings, something I could never have known, just asking if they're consistent given all of WP's default settings.
    – coolpasta
    Feb 10, 2019 at 17:10

1 Answer 1

0

I'm not exactly sure, if I get your question correctly, but...

Yes, these hooks are native WP hooks:

So if you create such page on given WP instance (for example you create it with your plugin/theme and that plugin/theme is active on that instance), then these hooks will get fired.

Of course if such page is not added on given WP instance, then that action won't get fired... (But how could it - if there is no such page, then it can't be displayed, then no actions will be run while it's requested).

I hope it answered your question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.