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.
I am using a plugin that let's me modify the user profile from front-end. But with this plugin, the plugins doesn't work even when "Enable Profile" is true. I guess the check for profile page in the code below looks incorrect. I have suggested the change. Let me know what you think.
Current way :
function dashboard_redirect() {
/** @global string $pagenow */
global $pagenow;
if ( 'profile.php' != $pagenow || ! $this->settings['enable_profile'] ) {
wp_redirect( $this->settings['redirect_url'] );
exit;
}
}
Suggested Way:
function dashboard_redirect() {
if ( ! IS_PROFILE_PAGE || ! $this->settings['enable_profile'] ) {
wp_redirect( $this->settings['redirect_url'] );
exit;
}
}
I am using a plugin that let's me modify the user profile from front-end. But with this plugin, the plugins doesn't work even when "Enable Profile" is true. I guess the check for profile page in the code below looks incorrect. I have suggested the change. Let me know what you think.
Current way :
Suggested Way: