Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Disallow users edit its own profile
- if( !current_user_can('activate_plugins') ) {
- function mytheme_admin_bar_render() {
- global $wp_admin_bar;
- $wp_admin_bar->remove_menu('edit-profile', 'user-actions');
- }
- add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' );
- function stop_access_profile() {
- if(IS_PROFILE_PAGE === true) {
- wp_die( 'Please contact your administrator to have your profile information changed.' );
- }
- remove_menu_page( 'profile.php' );
- remove_submenu_page( 'users.php', 'profile.php' );
- }
- add_action( 'admin_init', 'stop_access_profile' );
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement