Skip to content

Instantly share code, notes, and snippets.

@arfinmilondev
Created July 1, 2025 05:46
Show Gist options
  • Select an option

  • Save arfinmilondev/ea69ceec01724ef2ae83f32465057b53 to your computer and use it in GitHub Desktop.

Select an option

Save arfinmilondev/ea69ceec01724ef2ae83f32465057b53 to your computer and use it in GitHub Desktop.
Redirect affiliate users to the Affiliate area page when login through EDD Login form
<?php
//if the user is an affiliate. Based on that, you can redirect them either to the Affiliate Area or the EDD Customer Dashboard.
if ( ! function_exists( 'custom_edd_login_redirect' ) ) {
function custom_edd_login_redirect( $redirect_to, $user_id ) {
if ( function_exists( 'affwp_is_affiliate' ) && affwp_is_affiliate( $user_id ) ) {
return site_url( '/affiliate-area/' );
}
return $redirect_to;
}
add_filter( 'edd_login_redirect', 'custom_edd_login_redirect', 10, 2 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment