admin_page_access_denied WordPress Action Hook
The admin_page_access_denied hook is called when a user is denied access to a WordPress admin page.
do_action( 'admin_page_access_denied' ) #
Fires when access to an admin page is denied.
More Information
admin_page_access_denied is an action hook triggered when an user does not have permission to access a page in the control panel. This is most likely due to not having the required capability to access the page.
The action hook is fired before wp_die is executed, and is a result of the function user_can_access_admin_page returning false.
Basic Examples
function mwb_permission_error() { wp_redirect( site_url() ); exit; } add_action( 'admin_page_access_denied', 'mwb_permission_error');
Source
Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |