Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent users from creating new WordCamp and Meetup posts on central dashboard #1048

Merged
merged 5 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions public_html/wp-content/plugins/wcpt/wcpt-meetup/meetup-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading