Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created August 11, 2015 18:39
Show Gist options
  • Select an option

  • Save Pebblo/e62cc413138375b9b472 to your computer and use it in GitHub Desktop.

Select an option

Save Pebblo/e62cc413138375b9b472 to your computer and use it in GitHub Desktop.
Remove the WP User Integration Settings metabox from events for user that do not have the 'manage_option' capability.
<?php
// A function to remove the WP User Integration settings from events
// if the user account doe not have the 'manage_options' capability
// this capability is usually assigned to the Administrator role.
// Add this to your child theme's functions.php file or into a custom plugin
function ee_remove_wp_user_meta() {
if ( !current_user_can( 'manage_options' ) ) {
remove_meta_box( 'eea_wp_user_integration', 'espresso_events', 'side' );
}
}
add_action('do_meta_boxes', 'ee_remove_wp_user_meta');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment