diff --git a/src/Access.php b/src/Access.php index e1b84e9..10e8598 100644 --- a/src/Access.php +++ b/src/Access.php @@ -329,11 +329,11 @@ public function user_can_view_content( $args = [] ) { $group = new Group( $group_id ); $membership = new Membership( get_current_user_id() ); - if ($group_id) { + if ( $group_id ) { if ( ! is_user_logged_in() || ! $membership->is_valid_for_group( $group_id ) ) { return false; } - } + } if ( $is_member == 'yes' ) { // Check, if the user is logged in and is member of the group, if not, bail diff --git a/src/Membership.php b/src/Membership.php index d35c455..b4d3c6e 100644 --- a/src/Membership.php +++ b/src/Membership.php @@ -107,11 +107,11 @@ public function is_valid_for_group( $group_id ) { continue; } - if (!empty($group['subscription_date']) && $group['subscription_date'] >= date( 'Y-m-d' )) { + if ( ! empty( $group['subscription_date'] ) && $group['subscription_date'] >= date( 'Y-m-d' ) ) { return false; } - if (!empty($group['valid_to']) && $group['valid_to'] <= date( 'Y-m-d' )) { + if ( ! empty( $group['valid_to'] ) && $group['valid_to'] <= date( 'Y-m-d' ) ) { return false; }