Custom Post Type’s Capabilities map_meta_cap issues

Turns out it’s a real bad idea to map your own meta capabilities. To solve this problem I ended up going through the steps you would with a map_meta_cap function with TWO plugins.

Use [Map Cap] to automatically map the meta capabilities of my new custom post type to my specific user roles.

Then had to install the Very useful Members Plugin which I manually had to assign the capabilities with add_cap and double check within the plugin for proper cap assigning.

function role_set (){
global $wp_roles;

$role = get_role( 'administrator' );
$role->add_cap( 'publish_POST_TYPE' );
$role->add_cap( 'edit_POST_TYPE' );
$role->add_cap( 'edit_others_POST_TYPE' );
$role->add_cap( 'delete_others_POST_TYPE' );
$role->add_cap( 'read_private_POST_TYPE' );
$role->add_cap( 'manage_POST_TYPE' );

}
add_action('init', 'role_set');

Then double checked it within the members plugin. It took 4 days to get my custom post type capabilities working right with all roles. I do believe WordPress is LONG overdue for some core built roles and caps control. Hope this helps anyone out there.

Leave a Comment