Last active
January 21, 2021 22:43
-
-
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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