From 264409634857d0a3b5e4750dd994aef540593f21 Mon Sep 17 00:00:00 2001 From: Timi Wahalahti Date: Fri, 22 Sep 2023 10:11:17 +0300 Subject: [PATCH] set capabilities on registering the wordcamp CPT --- .../plugins/wcpt/wcpt-wordcamp/wordcamp-loader.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-loader.php b/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-loader.php index 40300ec295..af580bbf17 100644 --- a/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-loader.php +++ b/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-loader.php @@ -100,6 +100,19 @@ function register_post_types() { 'show_ui' => true, 'can_export' => true, 'capability_type' => WCPT_POST_TYPE_ID, + 'capabilities' => array( + // `read` and `edit_posts` are intentionally allowed, so organizers can edit their own posts (but not others'). + 'create_posts' => 'wordcamp_wrangle_wordcamps', + 'delete_posts' => 'wordcamp_wrangle_wordcamps', + 'delete_others_posts' => 'wordcamp_wrangle_wordcamps', + 'delete_private_posts' => 'wordcamp_wrangle_wordcamps', + 'delete_published_posts' => 'wordcamp_wrangle_wordcamps', + 'edit_others_posts' => 'wordcamp_wrangle_wordcamps', + 'edit_private_posts' => 'wordcamp_wrangle_wordcamps', + 'edit_published_posts' => 'wordcamp_wrangle_wordcamps', + 'publish_posts' => 'wordcamp_wrangle_wordcamps', + 'read_private_posts' => 'wordcamp_wrangle_wordcamps', + ), 'map_meta_cap' => true, 'hierarchical' => false, 'has_archive' => true,