This WordPress plugin limits user access to the dashboard based on whether users have a chosen capability. Disallowed users are redirected to a chosen URL.
Check whether global $pagenow has a value before relying on it. Since the hook is called using admin_init, I'm not sure exactly how the user has reached this code, but it's possible it could be called manually or via AJAX.
It's not a problem to check for it and to use the alternative code suggested by @shivchawla
Check whether global
$pagenow
has a value before relying on it. Since the hook is called usingadmin_init
, I'm not sure exactly how the user has reached this code, but it's possible it could be called manually or via AJAX.It's not a problem to check for it and to use the alternative code suggested by @shivchawla
Resolves #24