WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am attempting to create a custom role upon activation of my plugin. Along with that role, I wanted to add new capability to that role to access later. Now, after reading the Codex, I am totally confused. What is the purpose of the grant parameter? What good would it do to add a capability to a user/role and not grant access to it when WordPress doesn't offer access to check if the capability is granted? The has_cap method only returns true or false.

At this point, it looks like the direction I should go is just create new Roles and either assign those roles to my users or not. The capabilities were going to be a "neat" way of me adding the custom capabilities without cluttering up the role list when manually adding a user. It looks like this won't work for me. Anyone confirm what I am reading/finding?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.