WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Action Reference/admin page access denied

Contents

Description

admin_page_access_denied is an action hook triggered when a 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.

Parameters

There are no arguments passed to this hook.

Usage

<?php add_action( 'admin_access_page_denied', 'callback' ); ?>

Where "callback" is the name of a function, or method, to be executed.

Examples

<?php
add_action( 'admin_access_page_denied', 'my_plugin_log_permission_error');

function my_plugin_log_permission_error() {
    // your code here
}
?>

Change Log

Source

admin_page_access_denied is located in wp-admin/includes/menu.php on line 225.

This page is marked as incomplete. You can help Codex by expanding it.