Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Last active January 21, 2021 22:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/1f89ac4e0fd7f536f2cb to your computer and use it in GitHub Desktop.
Save joshfeck/1f89ac4e0fd7f536f2cb to your computer and use it in GitHub Desktop.
Event Espresso 4.2 and 4.3 capability filter examples. Thread: http://eventespresso.com/topic/ee4-creating-a-role-to-just-manage-espresso-events/
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
// give user roles that can 'publish_posts' access to events, registrations, transactions, registration forms
// roles will also need 'manage_options' cap
add_filter ('FHEE_management_capability', 'my_custom_menu_management_capability');
function my_custom_menu_management_capability() {
return 'publish_posts';
}
add_filter ('FHEE_espresso_events_capability', 'my_custom_espresso_events_capability');
function my_custom_espresso_events_capability($capability){
return 'publish_posts';
}
add_filter ('FHEE_espresso_registrations_capability', 'my_custom_espresso_registrations_capability');
function my_custom_espresso_registrations_capability($capability){
return 'publish_posts';
}
add_filter ('FHEE_espresso_transactions_capability', 'my_custom_espresso_transactions_capability');
function my_custom_espresso_transactions_capability($capability){
return 'publish_posts';
}
add_filter ('FHEE_espresso_registration_form_capability', 'my_custom_espresso_transactions_capability');
function my_custom_espresso_registration_form_capability($capability){
return 'publish_posts';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment