Okay, I finally figured out how to use Custom capabilities.
I created some sample code on the main welcome page…
sample:
[s2If current_user_can(access_s2member_level1)]
[membership_downloads_box title="Your Downloads"]
[_s2If current_user_can("access_s2member_ccap_mainfiles")]
<table border="0">
<tr>
<td valign="middle" align="left">
[securelink id=1]<img title="Main eBook Download" alt="Download Your eBook" src="/wp-content/uploads/imageFiles/eBook_cover_100wx130h.png" border="0" />[/securelink]
</td>
<td valign="middle" align="left" width="5">
</td>
<td valign="middle" align="left">Your Main eBook Download</td>
</tr>
</table>
[/_s2If]
[/membership_downloads_box]
[/s2If]
that puts the membership downloads box from OptimizePress there, but it is empty… so if I add another one:
[_s2If !current_user_can("access_s2member_ccap_mainfiles")]
You don't have access, but here is what should have displayed:
<table border="0">
<tr>
<td valign="middle" align="left">
[securelink id=1]<img title="Main eBook Download" alt="Download Your eBook" src="/wp-content/uploads/imageFiles/eBook_cover_100wx130h.png" border="0" />[/securelink]
</td>
<td valign="middle" align="left" width="5">
</td>
<td valign="middle" align="left">Your Main eBook Download</td>
</tr>
</table>
[/_s2If]
Then when I load the page, I see the no access one (the second one).
So I created a test account, went to the user account, added the custom capability: mainfiles
to that user in the S2Member area.
saved it.
logged in, in another browser, loaded that page, and the same thing happened.
Only the no access one showed up.
So, why did it not work?
Any ideas?
Thanks.
Richard – Damian’s dad