Timeline for Confusion with adding meta capabilities to a role after registering a Custom Post Type with corresponding 'capability_type' parameter
Current License: CC BY-SA 3.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 27, 2016 at 9:23 | answer | added | Apple | timeline score: -1 | |
Sep 26, 2011 at 13:30 | history | bounty ended | CommunityBot | ||
Sep 23, 2011 at 14:47 | answer | added | bluantinoo | timeline score: 2 | |
Sep 19, 2011 at 12:55 | history | edited | dashaluna | CC BY-SA 3.0 |
Added an edit - using hook in functions.php to add caps to the admin role
|
Sep 18, 2011 at 11:44 | history | bounty started | dashaluna | ||
Sep 14, 2011 at 14:26 | comment | added | dashaluna |
I'm still very confused, found a tutorial by Justin Tadlock, called "Meta capabilities for custom post types" justintadlock.com/archives/2010/07/10/… If I understand that correctly after adding capabilities to a role I would need to map them using map_meta_cap filter. I did follow Justin's tutorial, but after adding the map_meta_cap filter I still can't see anything under "External Roles". I'm very confused, would really appreciate any help! Thanks
|
|
Sep 14, 2011 at 9:30 | comment | added | dashaluna |
@tollmanz I'm adding capabilities in my functions.php file...hm I'm not using any hook, I just have the code of adding caps as it appears above. The edit/read/delete_external_role meta caps are granted, but only these ones, I thought that they would expand to include derived primitive caps, like edit_others_external_roles , but they don't. Do I need to specify every capability separately? Basically, I was trying to grand all the capabilities in a few lines of code. Hope that makes sense.
|
|
Sep 13, 2011 at 15:52 | history | tweeted | twitter.com/#!/StackWordPress/status/113641211897716736 | ||
Sep 13, 2011 at 15:50 | comment | added | tollmanz |
As far as I can tell, this generally looks good. Where are you running the code to add the capabilities? What hook is being used? It might be useful at different places in your script to do a var_dump of $wp_roles : global $wp_roles; var_dump( $wp_roles); . The only thing I can think of here is that perhaps there's an ordering issue at play...like the roles are being granted before the CPT is registered; however, with that said, I'm not sure that that would actually cause a problem. I may take a closer look at this later today.
|
|
Sep 13, 2011 at 12:12 | history | asked | dashaluna | CC BY-SA 3.0 |