strangerstudios / pmpro-pay-by-check

Add a "Pay by Check" option to PMPro levels, and keep members in "pending" status until an admin changes the order status.
https://www.paidmembershipspro.com/add-ons/pmpro-pay-by-check-add-on/
11 stars 27 forks source link

Fix membership shortcode for non-member users #83

Closed dparker1005 closed 1 year ago

dparker1005 commented 2 years ago

Issue:

  1. Using shortcode [membership level="0"]
  2. Logged in user without a membership level tries to view the content and should be able to
  3. is_user_logged_in() will be true
  4. pmprobpc_memberHasAccessWithAnyLevel( $current_user->ID ) will set $hasaccess to false since the user does not have a membership level

This behavior is incorrect. If we are trying to show content to non-members, then we absolutely don't want to hide the content because this logged-in non-member don't have a level.