Skip to content

Commit

Permalink
Merge pull request #83 from dparker1005/fix-member-shortcode-for-non-…
Browse files Browse the repository at this point in the history
…member-users

Fix membership shortcode for non-member users
  • Loading branch information
dparker1005 committed Aug 11, 2023
2 parents 9b46005 + de6e3e5 commit 5fc2705
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pmpro-pay-by-check.php
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,13 @@ function pmpropbc_pmpro_member_shortcode_access( $hasaccess, $content, $levels,
return $hasaccess;
}

// If we are checking if the user is not a member, we don't want to hide this content if they are pending.
foreach ( $levels as $level ) {
if ( intval( $level ) <= 0 ) {
return $hasaccess;
}
}

// We only need to run this check for logged-in user's as PMPro will handle logged-out users.
if ( is_user_logged_in() ) {
$hasaccess = pmprobpc_memberHasAccessWithAnyLevel( $current_user->ID, $levels );
Expand Down

0 comments on commit 5fc2705

Please sign in to comment.