WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#38428 closed defect (bug) (invalid)

admin_page_access_denied action never called

Reported by: solo14000 Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.6.1
Component: Administration Keywords:
Focuses: docs, administration Cc:

Description

Hello,

I have setup my own custom WP theme.
I'm trying to customize denied access to WP admin by registering my own callback on the 'admin_page_access_denied' hook.

But unfortunately, my callback is never called.

I have simply added the code snippet provided as example in the Codex (https://codex.wordpress.org/Plugin_API/Action_Reference/admin_page_access_denied) in my functions.php.

Can anyone confirm this?

Thanks

Change History (3)

#1 follow-up: @SergeyBiryukov
3 years ago

  • Component changed from Login and Registration to Administration

Interesting. Codex mentions that it's available since WordPress 2.5, but as far as I can tell, it has never been a part of any WordPress release.

I'd suggest removing the Codex page.

#2 in reply to: ↑ 1 @ocean90
3 years ago

Replying to SergeyBiryukov:

it has never been a part of any WordPress release.

Hmm, I can see the action in trunk/src/wp-admin/includes/menu.php?rev=37914&marks=335-340#L335.

#3 @SergeyBiryukov
3 years ago

  • Focuses docs added
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Ah, the example was wrong, it referenced admin_access_page_denied instead of admin_page_access_denied.

I've corrected the example. Thanks for the ticket, @solo14000!

Note: See TracTickets for help on using tickets.