Skip to content

Check for profile page looks incorrect/incomplete  #24

@shivchawla

Description

@shivchawla

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;
		}
	}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions