mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-13 19:56:27 +09:00
Fix redirection on login process
This commit is contained in:
@@ -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 '<input type="hidden" name="redirect_to" id="redirect_to" value="'.esc_url( $url ).'" />';
|
||||
@@ -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 '<input type="hidden" name="redirect_to" id="redirect_to" value="' . esc_url( $url ) . '" />';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user