Fix: Misleading Message When Accessing Admin Menu Page#7613
Fix: Misleading Message When Accessing Admin Menu Page#7613nirajgiriXD wants to merge 18 commits intoWordPress:trunkfrom
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @nirajgiri9860@googlemail.com. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Co-authored-by: Christoph Daum <c.daum@me.com>
| * @global string $plugin_page | ||
| * @global array $_registered_pages | ||
| */ | ||
| function admin_page_exists() { |
There was a problem hiding this comment.
Some phpunit tests for this function would be nice.
|
@nirajgiriXD I left some feedback for consideration. Also, could you bring this up to date with the latest trunk branch? |
Co-authored-by: John Parris <public@johnparris.com>
Co-authored-by: John Parris <public@johnparris.com>
|
@mindctrl Thanks for the feedback! I've implemented the suggested changes and updated the branch with the latest from trunk. |
mindctrl
left a comment
There was a problem hiding this comment.
Needs unit tests. Needs discussion about introducing a new action, if it's desired, and what its name should be.
Co-authored-by: Noruzzaman <noruzzamanrubel@gmail.com>
Co-authored-by: Noruzzaman <noruzzamanrubel@gmail.com>
Co-authored-by: Noruzzaman <noruzzamanrubel@gmail.com>
Co-authored-by: Noruzzaman <noruzzamanrubel@gmail.com>
Co-authored-by: Weston Ruter <westonruter@gmail.com>
Co-authored-by: Noruzzaman <noruzzamanrubel@gmail.com>
Co-authored-by: Shail Mehta <shailmehta25@gmail.com>
Co-authored-by: Huzaifa Al Mesbah <huzaifah4m@gmail.com>
Co-authored-by: Weston Ruter <westonruter@gmail.com>
Co-authored-by: Weston Ruter <westonruter@gmail.com>
Description
This PR addresses the issue where the misleading message
You do not have sufficient permissions to access this page.was displayed when attempting to access an admin page that doesn't exist. Instead of suggesting a permissions problem, the fix ensures that users are now shown a clearer message:The requested page does not exist.This provides a more accurate and user-friendly explanation when the page is missing or unavailable.Screenshot
Testing Instructions
The requested page does not exist.instead ofYou do not have sufficient permissions to access this page.Trac ticket: https://core.trac.wordpress.org/ticket/14060