I have this code in admin_init action
$role = get_role('New_Role');
if(!$role){
add_role( 'New_Role', 'New Role', array( 'new_cap' => true ) );
}
In user profile everything looks fine in User Roles till I save user with checked New Role. The result is
- The role of the user is still not checked, like he doesn't have this role
- The new section appears "Additional Capabilities: Capabilities new_role"
Note that Capability is NOT new_cap BUT new_role.
What am I doing wrong?