Fixed multiple redirection in page restriction

This commit is contained in:
champsupertramp
2015-11-25 20:38:20 +08:00
parent 727e45f58d
commit f6ef053dda
+2 -1
View File
@@ -25,9 +25,10 @@ class UM_Access {
do_action('um_access_post_settings');
if ( $this->redirect_handler && !$this->allow_access ) {
if ( $this->redirect_handler && !$this->allow_access && ! um_is_core_page('login') ) {
// login page add protected page automatically
if ( strstr( $this->redirect_handler, um_get_core_page('login') ) ){
$curr = $ultimatemember->permalinks->get_current_url();
$this->redirect_handler = esc_url( add_query_arg('redirect_to', $curr, $this->redirect_handler) );