From 4cf0272bec3edc3707a7abba27d6abe88055e7df Mon Sep 17 00:00:00 2001 From: Timi Wahalahti Date: Fri, 22 Sep 2023 10:15:47 +0300 Subject: [PATCH] set capabilities on registering the wp_meetup CPT --- .../plugins/wcpt/wcpt-meetup/meetup-loader.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/public_html/wp-content/plugins/wcpt/wcpt-meetup/meetup-loader.php b/public_html/wp-content/plugins/wcpt/wcpt-meetup/meetup-loader.php index 79a4a6e2d..5bd423498 100644 --- a/public_html/wp-content/plugins/wcpt/wcpt-meetup/meetup-loader.php +++ b/public_html/wp-content/plugins/wcpt/wcpt-meetup/meetup-loader.php @@ -152,6 +152,19 @@ public function register_post_types() { 'show_ui' => true, 'can_export' => true, 'capability_type' => Meetup_Application::POST_TYPE, + 'capabilities' => array( + // `read` and `edit_posts` are intentionally allowed, so organizers can edit their own posts (but not others'). + 'create_posts' => 'wordcamp_wrangle_meetups', + 'delete_posts' => 'wordcamp_wrangle_meetups', + 'delete_others_posts' => 'wordcamp_wrangle_meetups', + 'delete_private_posts' => 'wordcamp_wrangle_meetups', + 'delete_published_posts' => 'wordcamp_wrangle_meetups', + 'edit_others_posts' => 'wordcamp_wrangle_meetups', + 'edit_private_posts' => 'wordcamp_wrangle_meetups', + 'edit_published_posts' => 'wordcamp_wrangle_meetups', + 'publish_posts' => 'wordcamp_wrangle_meetups', + 'read_private_posts' => 'wordcamp_wrangle_meetups', + ), 'map_meta_cap' => true, 'hierarchical' => false, 'has_archive' => false,