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.

Home Forums aphid

About: aphid

Sorry, I've not written a description yet. I'll get to it soon!


Topics I'm Subscribed To

Viewing topic 1 (of 1 total)
Topic Count Last Reply
dynamic category protection

By:  aphid in: Community Forum

voices: 2
replies: 2

4 years, 7 months ago  Raam Dev

Viewing topic 1 (of 1 total)

Topics I've Started

Viewing topic 1 (of 1 total)
Topic Count Last Reply
dynamic category protection

By:  aphid in: Community Forum

voices: 2
replies: 2

4 years, 7 months ago  Raam Dev

Viewing topic 1 (of 1 total)

My Latest Replies (From Various Topics)

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Tuesday Jun 5th, 2012 at 12:52 pm #15544
aphid
Username: slope

well sometimes writing out a question helps one discover a solution. i have attempted this, and as far as i can tell this seems to work:

// dynamically protect categories a-z
$letters = range('a', 'z');

foreach ($letters as $l) {
    
    if(is_category('pizza_' . $l) && !current_user_can ("access_s2member_ccap_pizza_" . $l)) {
        header ("Location: " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
        exit ();
    }
    elseif (is_category('sandwich_' . $l) && !current_user_can ("access_s2member_ccap_sandwich_" . $l)) {
        header ("Location: " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
        exit ();
    }

}

i wonder about the performance considerations of this code, but something is perhaps better than nothing, eh?

take care my s2friends.

Viewing 1 replies (of 1 total)

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.