Skip to content

Instantly share code, notes, and snippets.

@nikitasinelnikov
Created April 30, 2021 10:16
Show Gist options
  • Save nikitasinelnikov/f702e24d476d1fd521ea7ff144267295 to your computer and use it in GitHub Desktop.
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
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