Embed Snippet on Your Site
MemberPress: Customize Unauthorized Message For Logged-Out Non-Authorised User and a Logged in Non-Authorised User
This snippet customizes the unauthorized message shown to users who attempt to access content protected by MemberPress rules. Instead of showing the same default message to everyone, it provides personalized messages based on whether the user is logged in and their subscription status.
To change the message shown to logged-in users who don't have an active subscription to the required membership, update the following lines of the code:
$message = 'Hello there! It looks like you don't have access to this content yet. Consider upgrading your membership to unlock full access!';
Replace the Hello there! It looks like you don't have access to this content yet. Consider upgrading your membership to unlock full access! message text with your preferred message.
The Welcome! To view this content, please sign up or log in. Join us now for exclusive access! message for logged-out users can be replaced on this line:
$message = 'Welcome! To view this content, please sign up or log in. Join us now for exclusive access!';
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Comments