admin_page_access_denied
Action HookDescription
Fires when access to an admin page is denied.Hook Information
File Location |
wp-admin/includes/menu.php
View on GitHub
|
Hook Type | Action |
Line Number | 378 |
Hook Parameters
This hook doesn't accept any parameters.
Usage Examples
Basic Usage
<?php
// Hook into admin_page_access_denied
add_action('admin_page_access_denied', 'my_custom_function');
function my_custom_function() {
// Your custom code here
}
Source Code Context
wp-admin/includes/menu.php:378
- How this hook is used in WordPress core
<?php
373 /**
374 * Fires when access to an admin page is denied.
375 *
376 * @since 2.5.0
377 */
378 do_action( 'admin_page_access_denied' );
379
380 wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
381 }
382
383 $menu = add_menu_classes( $menu );
PHP Documentation
<?php
/**
* Fires when access to an admin page is denied.
*
* @since 2.5.0
*/
Quick Info
- Hook Type: Action
- Parameters: 0
- File: wp-admin/includes/menu.php
Related Hooks
Related hooks will be displayed here in future updates.