latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Display Message when access needed not redire

Home Forums Community Forum Display Message when access needed not redire

This topic contains 1 reply, has 2 voices. Last updated by  Eduan 3 years, 9 months ago.

Topic Author Topic
Posted: Saturday Mar 23rd, 2013 at 1:24 pm #45567

Hi

I have set up my membership site using Level 1 and custom capabilities and paypal pro.

Is it possible to display a message when a user tries to click an option they do not have the custom capability for saying “You do not currently have access to this page – please see membership options and upgrade page”.

I see lots of mention of conditionals but none using custom capabilities.

Thanks

Simon

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Monday Mar 25th, 2013 at 8:45 pm #45688
Eduan
Username: Eduan
Moderator

Hello Simon,

Is it possible to display a message when a user tries to click an option they do not have the custom capability for saying “You do not currently have access to this page – please see membership options and upgrade page”.

Well, there isn’t actually that, you could probably pull it off with some JavaScript that only appears when the user doesn’t have access to it (so it doesn’t check if the user has access, it already knows and acts accordingly).

However the membership options page could also provide this I feel, however not as a popup, but as a redirect.

I see lots of mention of conditionals but none using custom capabilities.

Yes you can have conditionals based on custom capabilities:

[s2If current_user_can(access_s2member_ccap_free_gift)]
    Display free gift here. This Member has access to a Custom Capability that supplies a free gift.
[/s2If]

Or in PHP instead of shortcodes:

<?php if(current_user_can("access_s2member_ccap_free_gift")){ ?>
    Also display free gift here. This is a Custom Capability check, using a nested Conditional.
<?php } ?>

– Eduan

Viewing 1 replies (of 1 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.