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™
[s2If current_user_can(access_s2member_ccap_videos) OR current_user_can(access_s2member_ccap_video1)]
Show video 1.
[/s2If]
[s2If !current_user_can(access_s2member_ccap_videos) AND !current_user_can(access_s2member_ccap_video1)]
Show sales copy for video 1.
[/s2If]
<?php if (current_user_can('access_s2member_ccap_videos') || current_user_can('access_s2member_ccap_video1')) { ?>
Show video 1
<?php } else { ?>
Show sales copy for video 1.
<?php } ?>
<?php
add_action('template_rediret', 'my_custom_capabilities');
function my_custom_capabilities() {
if (is_category('trees') && (!current_user_can('access_s2member_ccap_trees' && !current_user_can('access_s2member_ccap_sitewide')) {
header('Location: ' . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit;
}
}
?>
[s2File download="example.zip" download_key="true" /]
<?php
/* Custom function for the s2member plugin. This denies access to content if user doesn't have a Custom Capability (ccap) equivalent to the category slug. If denied, user is redirected to the s2member subscription options page.
*/
add_action('template_redirect', 'my_custom_capabilities');
function my_custom_capabilities() {
$category = get_the_category();
$kat = $category[0]->category_nicename;
if (in_category($kat) && (!current_user_can('access_s2member_ccap_' . $kat))) {
header('Location: ' . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit;
}
}
?>
Users browsing this forum: No registered users and 0 guests