Created
July 20, 2020 22:26
-
-
Save Pebblo/52830fbd3bdaf61992a96cf78ab9b395 to your computer and use it in GitHub Desktop.
Example of how to override the capability check on the 'Contact List' tab shown on Event Espresso -> Registrations
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 if you do not alread have one | |
// Example of how to override the capability check on the 'Contact List' tab shown on Event Espresso -> Registrations | |
// This function simply returns false for that cap check unless the current user account has the 'manage_options' cap on the account. | |
add_filter('FHEE__EE_Capabilities__current_user_can__cap__espresso_registrations_contact_list', 'ee_tw_filter_contact_list_tab', 10, 2); | |
function ee_tw_filter_contact_list_tab($cap, $id) { | |
if(! current_user_can('manage_options') ){ | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment