Title: Modify create_events/create_posts capability?
Last modified: August 30, 2016

---

# Modify create_events/create_posts capability?

 *  Resolved [Jay](https://wordpress.org/support/users/topdownjimmy/)
 * (@topdownjimmy)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/modify-create_eventscreate_posts-capability/)
 * I’m trying to remove the “create_events” capability for a certain user role, 
   with little luck.
 * If I add:
 *     ```
       'create_posts' => 'create_events',
       ```
   
 * in `em-posts.php` in the `$event_post_type['capabilities']` array, I can remove
   this capability easily in my theme’s `functions.php` file, but without that, 
   I can’t.
 * How can I submit a patch to this plugin, or has anybody else had any luck doing
   something like this?
 * [https://wordpress.org/plugins/events-manager/](https://wordpress.org/plugins/events-manager/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [angelo_nwl](https://wordpress.org/support/users/angelo_nwl/)
 * (@angelo_nwl)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/modify-create_eventscreate_posts-capability/#post-6398030)
 * did you already tried to use user capabilities under events > settings > general
   > user capabilities or use other user role plugin ?
 *  Thread Starter [Jay](https://wordpress.org/support/users/topdownjimmy/)
 * (@topdownjimmy)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/modify-create_eventscreate_posts-capability/#post-6398034)
 * 1. `create_posts` isn’t in the Events settings.
    2. I haven’t tried other role
   plugins, I’d rather be able to do this myself. I don’t need the level of role
   modification that those large plugins allow.
 * I did figure out how to do this however:
 *     ```
       function cap_create_events($post_type, $args) {
   
         if ( 'event' != $post_type)
           return;
   
         global $wp_post_types;
   
         $args->cap->create_posts = 'create_events';
   
         $wp_post_types[ $post_type ] = $args;
       }
       add_action( 'registered_post_type', 'cap_create_events', 10, 2 );
   
       function prevent_contrib_create_events() {
         $role_object = get_role( 'contributor' );
         $role_object->remove_cap( 'create_events' );
       }
       add_action( 'init', 'prevent_contrib_create_events' );
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Modify create_events/create_posts capability?’ is closed to new replies.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=3550347)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

## Tags

 * [add_cap](https://wordpress.org/support/topic-tag/add_cap/)
 * [capabilities](https://wordpress.org/support/topic-tag/capabilities/)
 * [capability](https://wordpress.org/support/topic-tag/capability/)

 * 2 replies
 * 2 participants
 * Last reply from: [Jay](https://wordpress.org/support/users/topdownjimmy/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/modify-create_eventscreate_posts-capability/#post-6398034)
 * Status: resolved