Change WordPress user roles and capabilities Forums How to or FAQ Disable Edit my profile from right top admin dropdown Reply To: Disable Edit my profile from right top admin dropdown

#5469
Vladimir
Keymaster

URE does not hide this admin bar menu item by default.
Add this code to your active theme functions.php file or setup it as a must-use plugin to change default behavior:


add_filter('ure_do_not_remove_from_admin_bar', 'ure_do_not_remove_from_admin_bar', 10, 1);

function ure_do_not_remove_from_admin_bar( $exclusions ) {
    
    foreach( $exclusions as $key=>$item ) {
    
        if ( $item==='edit-profile' ) {
            unset( $exclusions[$key] ) ;
            break;
        }
    }

    return $exclusions;
}