how to hide user role from role drop down list ?

  • Welcome to Babiato Forum! All Resources are 100% clean and Safe to Use

orbitsolutions

Active member
May 5, 2022
213
69
28
// Remove Administrator role from roles list
add_action( 'editable_roles' , 'hide_adminstrator_editable_roles' );
function hide_adminstrator_editable_roles( $roles ){
if ( isset( $roles['administrator'] ) && !current_user_can('level_10') ){
unset( $roles['administrator'] );
}
return $roles;
}

where I place code? function.php ?
 
  • Like
Reactions: jamjaman

About us

  • Babiato Forum - The webmaster community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day, updating Daily resource to make sure our community is one of the best.

Quick Navigation

User Menu