Change WordPress user roles and capabilities Forums How to or FAQ Hide Product Content Editor (Visual/Text + Visual Composer) from Role Reply To: Hide Product Content Editor (Visual/Text + Visual Composer) from Role

#2742
Vladimir
Keymaster

Hi,

Try this recipe:


add_action('admin_init', 'remove_product_editor');
function remove_product_editor() {

  if (current_user_can('product-meta-editor')) {
    remove_post_type_support('product', 'editor');
  }
  
}

Replace role ID ‘product-meta-editor’ with your own as ‘sales-manager’. Add this code to the active theme functions.php file or setup it as a must use plugin.