Created
April 30, 2021 10:16
-
-
Save nikitasinelnikov/f702e24d476d1fd521ea7ff144267295 to your computer and use it in GitHub Desktop.
Ultimate Member: Custom redirect after registration with auto-approve user based on the current language via WPML plugin
This file contains hidden or 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
function um_custom_registration_redirect( $user_id ) { | |
if ( UM()->external_integrations()->is_wpml_active() ) { | |
global $sitepress; | |
$language_code = $sitepress->get_current_language(); | |
if ( $language_code == 'fi' ) { | |
$redirect_url = 'redirect_url1'; | |
} else { | |
$redirect_url = 'redirect_url2'; | |
} | |
exit( wp_redirect( $redirect_url ) ); | |
} | |
} | |
add_action( 'um_registration_after_auto_login', 'um_custom_registration_redirect' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment