Skip to content

Instantly share code, notes, and snippets.

@kirilkirkov
Created February 27, 2022 07:48
Show Gist options
  • Save kirilkirkov/dcc281f642c179df608e04c24dedbeb6 to your computer and use it in GitHub Desktop.
Save kirilkirkov/dcc281f642c179df608e04c24dedbeb6 to your computer and use it in GitHub Desktop.
When is admin_init Action ran?
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