Created
February 27, 2022 07:48
-
-
Save kirilkirkov/dcc281f642c179df608e04c24dedbeb6 to your computer and use it in GitHub Desktop.
When is admin_init Action ran?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
admin_init is triggered when a user accesses the admin area. It is the first hook to be triggered. It can be used in cases like: | |
We want to block access to the admin panel for users that do not have the Administrator Role. | |
We want automatic redirection of users lacking the specified capability, to the homepage. | |
We want to register a new setting for use by a plugin. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment