Remove Visual Editor for Custom Role

Question

I want to remove visual editor from custom role, after I applied the code below, it hides the visual editor from all roles including admin. Need help thank you in advanced

//remove visual editor for custom role
function remove_visual_editor($tabs) 
{
 
  if (!current_user_can('wdm_instructor')) {  // replace role ID with your own
      return $tabs;
  }

  
return $tabs;
}

add_filter('user_can_richedit', '__return_false', 'remove_visual_editor');
0
jasaweb 4 months 0 Answers 70 views 0

Leave an answer