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.

Custom Capabilities and API Scripting

Home Forums Community Forum Custom Capabilities and API Scripting

This topic contains 0 replies, has 1 voice. Last updated by  Richard Rittorno 3 years, 10 months ago.

Topic Author Topic
Posted: Wednesday Feb 13th, 2013 at 10:46 am #41611

Hello,

I’ve read through the post here concerning the Custom Capabilities and API scripting and did find a update since the video, However, I’m still having problems and was wondering if anyone might be able to help.

I’m looking to restrict a category to level 1 with the custom capabilities of “optionweekly” as per the video I place the PHP code into the functions.php file of theme.

The issue is the code is not restricting access and allows for everyone to view. If I place CC keyword into the post Custom Capability under SA options everything is great but I’m looking do this through the Functions file and automate

Any help would greatly appreciated….

Functions.php – Code

<?php

add_action ("wp", "my_custom_capabilities");

function my_custom_capabilities ()
{

if (is_category ('weeklyoption') && !current_user_can ('access_s2member_ccap_woi'))
{
header ('location: '. S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}

}

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.