1
vote
1answer
297 views

add_cap only adding the first two in array

After numerous days of trying to track down a problem in code, it turns out that the add_cap is only taking the first two in an array. The first one (editor) will only add delete_others_pages and ...
1
vote
0answers
60 views

Purpose of Adding Capability to Role But Not Grant?

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 ...
3
votes
1answer
361 views

The 'user_has_cap' hook seems to take two page loads to trigger

This question relates to another question I asked recently (http://wordpress.stackexchange.com/questions/29009/how-to-assign-specific-users-the-capability-to-edit-specific-pages-posts-cus/), the ...
5
votes
1answer
833 views

Confusion with adding meta capabilities to a role after registering a Custom Post Type with corresponding 'capability_type' parameter

I got quite confused with Custom Post Type (CPT) 'capability_type' parameter and adding generated capabilities to a role. So I've got a CPT called 'external_role' registered as following: ...
0
votes
3answers
2k views

How can I grant capabilities directly to users (not roles) in wp-admin?

I want to create dynamic capabilities using WP_Role::add_cap(), something like $author_role = get_role('author'); foreach ($sections as $section) { $author_role->add_cap( ...