diff --git a/includes/admin/templates/role/admin.php b/includes/admin/templates/role/admin.php index 4053cbbe..26cdca6b 100644 --- a/includes/admin/templates/role/admin.php +++ b/includes/admin/templates/role/admin.php @@ -17,7 +17,7 @@ 'type' => 'checkbox', 'label' => __( 'Force hiding adminbar in frontend?', 'ultimate-member' ), 'tooltip' => __( 'Show/hide the adminbar on frontend', 'ultimate-member' ), - 'value' => ! empty( $role['_um_can_not_see_adminbar'] ) ? $role['_um_can_not_see_adminbar'] : 0, + 'value' => ! empty( $role['_um_can_not_see_adminbar'] ) ? $role['_um_can_not_see_adminbar'] : 1, ), array( 'id' => '_um_can_edit_everyone', diff --git a/includes/admin/templates/role/home.php b/includes/admin/templates/role/home.php index 4052b9c8..9440f3a7 100644 --- a/includes/admin/templates/role/home.php +++ b/includes/admin/templates/role/home.php @@ -11,7 +11,7 @@ 'type' => 'checkbox', 'label' => __( 'Can view default homepage?', 'ultimate-member' ), 'tooltip' => __( 'Allow this user role to view your site\'s homepage', 'ultimate-member' ), - 'value' => ! empty( $role['_um_default_homepage'] ) ? $role['_um_default_homepage'] : 0, + 'value' => ! empty( $role['_um_default_homepage'] ) ? $role['_um_default_homepage'] : 1, ), array( 'id' => '_um_redirect_homepage', diff --git a/includes/core/class-access.php b/includes/core/class-access.php index d74b32c4..2bf67eed 100644 --- a/includes/core/class-access.php +++ b/includes/core/class-access.php @@ -189,7 +189,8 @@ if ( ! class_exists( 'Access' ) ) { if ( is_front_page() ) { if ( is_user_logged_in() ) { - if ( ! empty( um_user( 'default_homepage' ) ) ) + $user_default_homepage = um_user( 'default_homepage' ); + if ( ! empty( $user_default_homepage ) ) return; $redirect_homepage = um_user( 'redirect_homepage' ); diff --git a/includes/core/um-actions-access.php b/includes/core/um-actions-access.php index 50649d18..48cd3b2a 100644 --- a/includes/core/um-actions-access.php +++ b/includes/core/um-actions-access.php @@ -14,7 +14,8 @@ function um_access_profile( $user_id ) { um_fetch_user( $user_id ); - if ( ! in_array( um_user( 'account_status' ), array( 'approved' ) ) ) { + $account_status = um_user( 'account_status' ); + if ( ! in_array( $account_status, array( 'approved' ) ) ) { um_redirect_home(); }