Hi, I’ve been struggling with this for a while. I can’t seem to pass a custom capability using this hook. It works fine for the Role but not for the ccap. I’m approaching this wrong. Any help would be appreciated.
/* Forces the default role of a new user to be set to "S2Member Level1" instead of "Subscriber" */
add_filter("ws_plugin__s2member_force_default_role", "default_role",10,1);
function default_role($role){
$return = 's2member_level1';
$user = wp_get_current_user();
$user->add_ccap('access_s2member_ccap_special');
return $return;
}
Thanks