Custom Redirect URL After New Membership

The following filter allows you to set a custom URL where customers will be taken after subscribing to a membership. The default URL is the Account Page set under WP Videos -> Membership Settings -> Page Settings in your WordPress Dashboard.

*IMPORTANT: The following filter must return a valid URL

function wpvs_custom_redirect_url_after_new_membership($redirect_url, $membership_id) {
    $redirect_url = 'https://yourdomain.com/custom-url';

    // OR SOMETHING LIKE
    $redirect_post_id = 443; // set to specific Post / Page ID to redirect to
    $redirect_url = get_permalink($redirect_post_id);

    // CHANGE REDIRECT URL DEPENDING ON MEMBERSHIP
    if( $membership_id == 'WeekTest') {
        $redirect_url = 'https://yourdomain.com/specific-landing-page';
    }

    return $redirect_url;
}
add_filter('wpvs_after_new_membership_redirect_link', 'wpvs_custom_redirect_url_after_new_membership', 10, 2);