Selectively Locking Hyperlinks from Non-Members
-
Hello,
First off, thanks for the great plugin! Loved it.
I’m trying to achieve the following requirements:
- On all pages, allow access to content, but restrict access to specified hyperlinks.
- If the user is not logged in, and tries to click on the link, a pop-up appears with a box asking the user to sign in, or create a new account
I’m planning to approach this problem using the following solution:
- Using the utility:
SwpmMemberUtils::is_member_logged_in()
Check if the user is logged in - If user is logged in, do nothing to content
- If user is not logged in, use php/js to find specific URLs that I want to restrict, and edit the URL such that it points to a pop-up/modal instead of going to the correct URL
I’ll like to understand if this is possible – if so, where can I begin? Specifically, are there any filter/action hooks that allow me to target specific tags based on ids, etc? In addition, are there any tutorials that might be able to get me started?
Apologies that I do not currently have a working copy of the code – I’m still trying to wrap my mind around how the WordPress hooks system works, and how to best go about this problem.
Appreciate your help! Let me know if you’ll like me to be more specific.
- The topic ‘Selectively Locking Hyperlinks from Non-Members’ is closed to new replies.