If you want to change the page that users are redirected to, you can add this small script to your functions.php file or snippets file:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Change the URL that users are redirected to | |
*/ | |
function prefix_redirect_url( $url ) { | |
return 'http://yournewurl.com/'; | |
} | |
add_filter( 'wcmo_redirect_url', 'prefix_redirect_url' ); |
Don’t forget to update the URL…
Filter redirect based on user role
You can filter the redirect URL based on the current user’s role – so you can direct Gold Members to a different page from Silver Members for example:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Change the redirect URL depending on user role | |
*/ | |
function prefix_redirect_url_per_role( $url ) { | |
// Get the current user roles | |
$roles = wcmo_get_current_user_roles(); | |
if( in_array( 'gold', $roles ) ) { | |
// Redirect to specific page for Gold role | |
return 'http://yournewurl.com/gold'; | |
} else if( in_array( 'silver', $roles ) ) { | |
// Redirect to specific page for Gold role | |
return 'http://yournewurl.com/silver'; | |
} | |
// This is the default URL | |
return $url; | |
} | |
add_filter( 'wcmo_redirect_url', 'prefix_redirect_url_per_role' ); |
You’ll need to edit the snippet to include your user roles.