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.

Show posts with custom capabilities only

Home Forums Community Forum Show posts with custom capabilities only

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

Topic Author Topic
Posted: Thursday Aug 9th, 2012 at 2:14 am #21589
John Mu
Username: imd

Hello. I’m developing a theme, can you direct me or give me an example on how could I show in the Welcome page, after successfully logging in of a user a certain posts with custom capabilities.

I only have this as a reference:

<?php if(current_user_cannot("access_s2member_level4") && (current_user_can("access_s2member_level2") || current_user_can_for_blog(24, "access_s2member_level2"))) { ?>
    
    This Member CANNOT access Level #4, but...
    they CAN access Level #2 on this Blog, OR (||) on Blog ID# 24. ( i.e. Multisite Networking )
    
    <?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 } ?>
    
<?php } else if(current_user_can("access_s2member_level1") || current_user_can_for_blog(24, "access_s2member_level1")) { ?>

    Content for Members who can access Level #1 on this Blog, OR (||) on Blog ID# 24. ( i.e. Multisite Networking )

<?php } else if(is_user_not_logged_in()) { ?>

    Some public content.

<?php } ?>

Instead of a text under ccap_free_gift, I want to show the posts under a custome capability ccap_free_gift.

How can I do that?

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Thursday Aug 9th, 2012 at 9:34 am #21628
Eduan
Username: Eduan
Moderator

You might be interested in the documentation here John:
Dashboard -› s2Member® -› API / Scripting -› Advanced Query Conditionals

Hope this helps. :)

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.