trustedlogin / Remove-Dashboard-Access

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.
https://wordpress.org/plugins/remove-dashboard-access-for-non-admins/
49 stars 12 forks source link

Address potential issue with frontend profile editing #30

Closed zackkatz closed 2 years ago

zackkatz commented 2 years ago

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

Resolves #24