From 80d9ad689ef1b0ac7cd88acbbede710e1c126855 Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Tue, 4 Oct 2016 21:55:47 +0800 Subject: [PATCH] Fix redirection on login process --- core/um-actions-misc.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/um-actions-misc.php b/core/um-actions-misc.php index 0345cc66..4dda7f90 100644 --- a/core/um-actions-misc.php +++ b/core/um-actions-misc.php @@ -4,10 +4,12 @@ *** @add a force redirect to from $_get ***/ add_action('um_after_form_fields', 'um_browser_url_redirect_to'); - function um_browser_url_redirect_to($args) { + function um_browser_url_redirect_to( $args ) { global $ultimatemember; + $url = ''; + if ( isset( $_REQUEST['redirect_to'] ) && !empty( $_REQUEST['redirect_to'] ) ) { $url = $_REQUEST['redirect_to']; echo ''; @@ -32,17 +34,16 @@ $url = $ultimatemember->permalinks->get_current_url(); - if ( defined('DOING_AJAX') && DOING_AJAX ) { - $url = apply_filters('um_browser_url_redirect_to__filter', $url ); - } - break; } + } + + $url = apply_filters('um_browser_url_redirect_to__filter', $url ); + if( ! empty( $url ) ){ echo ''; - } }