Add Custom User Capabilities Before or After the Custom User Role has Been Added?
There’s a reason why add_role() has the $capabilities as 3rd parameter. First some insights on what happens, when you use the function. It calls WP_Roles->add_role() – the class method The method then does a check if the role already exists. If yes, it aborts. The next step is, that it adds the role to WP_Roles->roles[] … Read more