Custom Capabilities are an extension to a feature that already exists in WordPress®. The current_user_can() function, can be used to test for these additional Capabilities that you allow. Whenever a Member completes the checkout process, after having purchased a Membership from you ( one that included Custom Capabilities ), s2Member will add those Custom Capabilities to the account for that specific Member.
Custom Capabilities are always prepended with access_s2member_ccap_. You fill in the last part, with ONLY lowercase alpha-numerics and/or underscores. For example, let's say you want to sell Membership Level #1, as is. But, you also want to sell a slight variation of Membership Level #1, that includes the ability to access the Music & Video sections of your site. So, instead of selling this additional access under a whole new Membership Level, you could just sell a modified version of Membership Level #1. Add the the Custom Capabilities: music,videos. Once a Member has these Capabilities, you can test for these Capabilities using current_user_can("access_s2member_ccap_music") and current_user_can("access_s2member_ccap_videos").
*New* Starting with s2Member v3.2+, you can now tell s2Member to require certain Custom Capabilities on a per Post/Page basis. So now, s2Member ( if you prefer ) CAN handle Custom Capabilities for you automatically! Whenever you edit a Post/Page, you can tell s2Member ( i.e. there is a Meta Box for s2Member in your Post/Page editing station )... you can tell s2Member to require certain Custom Capabilities that you type in, using comma-delimited format. In other words, you will need to type in some of the trigger words that you used whenever you created your Payment Buttons/Forms. This way paying Members will have the Custom Capabilities to view different kinds of content that you offer
Statistics: Posted by Raam Dev — November 15th, 2011, 1:52 pm
Statistics: Posted by jmccoskery — November 15th, 2011, 1:30 pm