Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubboucek committed Feb 1, 2021
1 parent f3e1e71 commit e1c06c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Access.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e1c06c5

Please sign in to comment.