WordPress Affiliate Manager

Affiliates Management Plugin for WordPress

  • Home
  • Features
    • Screen Shots
  • Download
  • Documentation
  • Addons
  • Support
    • Support Forum
    • Forum Login
    • Forum Registration
    • Contact
    • Premium Addon/Plugin Support

[Resolved] Affiliate Login page redirects to wp-admin login page

by

WordPress Affiliate Manager › Forums › Affiliate Manager Plugin › Affiliate Login page redirects to wp-admin login page

  • This topic has 2 replies, 3 voices, and was last updated 4 years, 3 months ago by spamis.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • March 11, 2021 at 12:59 pm #7230
    Anonymous
    Inactive

    As explained above !!!
    my affiliate login page
    its url https://curiouspiyuesh.com/affiliate-home/affiliate-login/
    irrespective of username and password it redirects to wpadmin page . kindly help me out solve this

    March 12, 2021 at 5:00 am #7232
    Shadow Labs
    Keymaster

    @Revathi, Is it for a successful login? The login redirection won’t work if another plugin overrides the URL: https://wpaffiliatemanager.com/forums/topic/login-redirect-issue-with-pmpro/

    March 16, 2021 at 8:00 pm #7237
    spamis
    Participant

    I am using WP Affiliate Manager and had this same problem – failed login defaulting to the WordPress login page. I found this snippet online and it worked for me with my theme’s (Divi) login page. With failed login it now stays on the same login page. The only thing I can’t get to work is there is no error message telling the user that the login failed. Anyway, you need to put the snippet it in your theme’s function.php file which is hopefully in a child theme folder. I hope this works for you.

    function wpcc_front_end_login_fail( $username ) {
    $referrer = $_SERVER[‘HTTP_REFERER’];
    if ( !empty( $referrer ) && !strstr( $referrer,’wp-login’ ) && !strstr( $referrer,’wp-admin’ ) ) {
    $referrer = esc_url( remove_query_arg( ‘login’, $referrer ) );
    wp_redirect( $referrer . ‘?login=failed’ );
    exit;
    }
    }
    add_action( ‘wp_login_failed’, ‘wpcc_front_end_login_fail’ );

    function custom_authenticate_wpcc( $user, $username, $password ) {
    if ( is_wp_error( $user ) && isset( $_SERVER[ ‘HTTP_REFERER’ ] ) && !strpos( $_SERVER[ ‘HTTP_REFERER’ ], ‘wp-admin’ ) && !strpos( $_SERVER[ ‘HTTP_REFERER’ ], ‘wp-login.php’ ) ) {
    $referrer = $_SERVER[ ‘HTTP_REFERER’ ];
    foreach ( $user->errors as $key => $error ) {
    if ( in_array( $key, array( ’empty_password’, ’empty_username’) ) ) {
    unset( $user->errors[ $key ] );
    $user->errors[ ‘custom_’.$key ] = $error;
    }
    }
    }

    return $user;
    }
    add_filter( ‘authenticate’, ‘custom_authenticate_wpcc’, 31, 3);

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

Featured Addons

  • WooCommerce Coupon Tracking
  • WooCommerce Product Specific Commission

Copyright © 2025 | WordPress Affiliate Manager | Privacy Policy