Skip to content

Instantly share code, notes, and snippets.

@yuriinalivaiko
Created November 6, 2022 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuriinalivaiko/6e10677c2b8d1cf59187364304233e27 to your computer and use it in GitHub Desktop.
Save yuriinalivaiko/6e10677c2b8d1cf59187364304233e27 to your computer and use it in GitHub Desktop.
Hook um_login_redirect_url
<?php
/**
* Hook: um_login_redirect_url
*
* Type: filter
*
* Description: Change redirect URL after successful login.
*
* @example https://github.com/ultimatemember/ultimatemember/blob/master/includes/core/um-actions-login.php#L258
*
* @package um\core
* @see um_user_login()
* @since 2.0
* @version 3.0
*
* @param srting $url Redirect URL.
* @param int $user_id User ID
*
* @return string Redirect URL.
*/
function my_login_redirect_url( $url, $user_id ) {
// your code here.
return $url;
}
add_filter( 'um_login_redirect_url', 'my_login_redirect_url', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment