There’s no easy way to do that.
However, if you’re familiar with WordPress development, you could use the admin_page_access_denied hook to display your own error message or redirect the user somewhere. Admin Menu Editor triggers this hook just before it displays its “you do not have permission” error message. Technically, it would be possible to write a hook callback that shows something else and then stops script execution before AME can show the default message.
Thanks for the quick reply 🙂
I’ll give it a go and see if I can figure that out and I’ll post back with my findings
Ok so I think it’s working right, based off this codex reference – https://developer.wordpress.org/reference/hooks/admin_page_access_denied/
I came up with this…
function awol_admin_page_access_denied() {
// trigger 404, custom text or redirect etc here
awol_trigger_404(); // just a custom function I use to produce a 404 page
die(); // force script to exit here and stops default plugin response
};
// add the action
add_action( 'admin_page_access_denied', 'awol_admin_page_access_denied' );
Thanks for helping me in the right direction, hopefully this code will help someone else 🙂
That looks like fine to me. I’ll mark this as resolved.
Yep I’m happy with this, thank you very much ! 🙂