I have two different custom capabilities (2 products sold) and if someone doesn’t have access I want it to redirect to two different pages when they try to access the product (the sales page for each one)
So, I currently have this in functions.php
add_action (“wp”, “my_custom_capabilities”);
function my_custom_capabilities()
{
if(has_tag(“sps_porter”) && !current_user_can (“access_s2member_ccap_sps_porter”))
{
header ("Location: Location: https://mydomain/sales-pg-1);
EXIT ();
}
else if(has_tag(“tbr”) && !current_user_can (“access_s2member_ccap_tbr”))
{
header (“Location: https://mydomain/sales-page-2”);
EXIT ();
}
}
The problem is that no matter which blocked page they try to access it simply takes them to the membership options page in the general settings