Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/fcc1da76ca446ec13c69 to your computer and use it in GitHub Desktop.
Save joshfeck/fcc1da76ca446ec13c69 to your computer and use it in GitHub Desktop.
This will hide the Export All buttons from the users with the Event Manager role. Event Espresso 3 + Roles and Permissions add-on required.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action('admin_head', 'my_custom_hide_buttons_for_event_managers');
function my_custom_hide_buttons_for_event_managers() {
global $pagenow;
if( $pagenow == 'admin.php' && ! current_user_can( 'espresso_group_admin' ) ) {
echo '<style>
#form1[action="admin.php?page=events"] a.button-secondary[title="Export to Excel"] {display:none !important;}
</style>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment