Custom Capabilities (hardcode url member options page)
-
Hi
After following the custom capabilities videos by Jason I have added the following code to my functions.php file:
add_action ("template_redirect", "my_custom_capabilities"); function my_custom_capabilities () { if(is_category ("blink_182_guitar_course") && !current_user_can ("access_s2member_ccap_blink_182_guitar_course")) { header ("Location: ". S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL); exit (); } else if(is_category ("techniques_guitar_course") && !current_user_can ("access_s2member_ccap_techniques_guitar_course")) { header ("Location: ". S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL); exit (); } }However instead of using the same membership options page for both product/membership access levels – I would like to redirect to a different URL for each product.
I tried replacing part of the code… from this:
header (“Location: “. S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);TO
header (“Location: “. fastfingerfreddy.com);
but this forced my entire site to not load so clearly I was doing something wrong. Can you please let know which part to remove and where I should enter my address – eg http://www.fastfingerfreddy.com
Please be as detailed as possible, do I need to use speechmarks etc
Also, can I just confirm that the entire code I have used above is actually correct as on the video by Jason (https://www.youtube.com/watch?v=h7zBH938VbA), the code he copies from the API Scripting section is different to the code he then edits on the functions.php file – please watch the video from around the 7min mark and you’ll see what I mean
Thanks
Rich
The topic ‘Custom Capabilities (hardcode url member options page)’ is closed to new replies.