Created
August 11, 2015 18:39
-
-
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.
This file contains hidden or 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 | |
| // 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