Redirect to previous page with Ultimate Member
-
Hi,
I know that there is another case with this same problem in the forum and I was reading it, but in the end there was no solution and they sent the user to write by email. So I don’t see a solution.
I tried the options listed in the plugin documentation: https://docs.ultimatemember.com/article/1802-redirect-to-the-previous-page-after-login
But I tried to try with what I understood of the wording but I don’t understand that wording.
What I did was:
Step 1:
I accessed the path: /plugins/ultimate-member/templates/login.phpPaso 2:
I added the codeecho "<input type='hidden' name='um_browser_url_redirect_to_filter' value='".$_SERVER['HTTP_REFERER']."'>";
just before the tags
?></form>
Step 3:
I pasted the following code in the functions.php file/** * Redirect to the previous page after login via the Ultimate Member login form. */ add_filter( 'um_browser_url_redirect_to__filter', function( $url ) { if ( empty( $url ) && isset( $_SERVER['HTTP_REFERER'] ) ) { $url = esc_url( wp_unslash( $_SERVER['HTTP_REFERER'] ) ); } return add_query_arg( 'umuid', uniqid(), $url ); } );
I tried switching between redirect to profile and refresh active page in the redirect defined in the profiles setting in Ultimate member > User roles > Action to take after login.
But nothing worked.
Can you help me, please?
- The topic ‘Redirect to previous page with Ultimate Member’ is closed to new replies.