PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

protected page link in profile if subscribed.

s2Member Plugin. A Membership plugin for WordPress®.

protected page link in profile if subscribed.

Postby squizeers » January 4th, 2012, 9:35 am

I was wondering if there is a way to automatically list the links of the protected pages in the profile page if the user has subscribed them.
For example:
    The protected pages are A,B,C and D
    A user subscribes for page A and B.
    When the user logs into the site, the user lands on his profile page (thats how I have set up).
    Now in the same page is there a way to list the links for pages A and B so that the user does not have to go to the options page to click on the links he has subscribed?
    Or is there a better solution for what I am looking to achieve and I am not doing it right?

Any help will be much appreciated.
Thank you.
User avatar
squizeers
Registered User
Registered User
 
Posts: 7
Joined: November 23, 2011

Re: protected page link in profile if subscribed.

Postby Raam Dev » January 4th, 2012, 7:32 pm

If you're using Custom Capabilities to determine which page the user has subscribed to, you could use Simple/Shortcode Conditionals to check which Custom Capabilities they have access to and then show the link to the page.

So on the Login Welcome Page, you could do something like this:

[s2If current_user_can(access_s2member_ccap_pageA)]
<a href="/link-to-page-a">Your Page A Link</a>
[/s2If]

[s2If current_user_can(access_s2member_ccap_pageB)]
<a href="/link-to-page-b">Your Page B Link</a>
[/s2If]

[s2If current_user_can(access_s2member_ccap_pageC)]
<a href="/link-to-page-c">Your Page C Link</a>
[/s2If]


Would that work?
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: protected page link in profile if subscribed.

Postby squizeers » January 4th, 2012, 8:55 pm

You are my Super Hero.
User avatar
squizeers
Registered User
Registered User
 
Posts: 7
Joined: November 23, 2011

Re: protected page link in profile if subscribed.

Postby Raam Dev » January 4th, 2012, 9:17 pm

:) My pleasure!
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: Majestic-12 [Bot] and 2 guests

cron