If you’re using the Email Confirmation Add On to validate member email addresses, this code recipe will set up a redirect to the Membership Account page when a member clicks the validation link….
The code recipe below sets membership restriction on a Custom Post Type (CPT) category. When a non-member visits a CPT in a protected category (either a logged out visitor or a logged in user without membership access) they will be redirected to the membership levels page (or another page as defined in your custom function).
The steps below will allow you to set a referrer in the Memberships > Advanced Settings for your “Message for Logged-out Users:”. This way, when a user clicks to “log in” to view the members-only content, they will be redirected back to that URL after login….
We’ve blogged previously about requiring a specific level to allow registration for another level. In that post, the registration check occurs after the user submits the checkout form. This new code gist immediately redirects away from the checkout page if the user’s current membership level is not ID = 1 or is unset. Again… why…