Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix membership shortcode for non-member users #83

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pmpro-pay-by-check.php
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,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 );
Expand Down