From ee0e88c6ac9ff4d0c59947b0964a4f07b5296f9a Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Wed, 15 Jun 2016 15:58:13 +0800 Subject: [PATCH] Fix access settings --- core/um-actions-access.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/core/um-actions-access.php b/core/um-actions-access.php index f616ec48..70c61b44 100644 --- a/core/um-actions-access.php +++ b/core/um-actions-access.php @@ -204,8 +204,12 @@ case 2: - if ( !is_user_logged_in() ){ - if ( !$access_redirect ) $access_redirect = um_get_core_page('login'); + if ( ! is_user_logged_in() ){ + + if ( empty( $access_redirect ) ) { + $access_redirect = um_get_core_page('login'); + } + $redirect_to = esc_url( $access_redirect ); } @@ -230,10 +234,8 @@ } if ( $redirect_to ) { - if ( is_feed() ) { - - } else { - $ultimatemember->access->allow_access = false; + if ( ! is_feed() ) { + $ultimatemember->access->allow_access = false; $ultimatemember->access->redirect_handler = esc_url( $redirect_to ); } }