Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created March 21, 2016 23:08
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/26ffd642c6485d3a8e0e to your computer and use it in GitHub Desktop.
Save joshfeck/26ffd642c6485d3a8e0e to your computer and use it in GitHub Desktop.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
// remove the add registrations csv report button for non-admins
//
add_action( 'admin_footer', 'my_remove_all_registrations_csv_button' );
function my_remove_all_registrations_csv_button() {
$screen = get_current_screen();
if ( $screen->base != 'event-espresso_page_espresso_registrations' ) {
return;
} else {
if ( ! current_user_can( 'ee_read_others_registrations' ) ){
?>
<script>
jQuery(document).ready(function($) {
$('#all-registrations-csv-report').remove();
});
</script>
<?php
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment