How to change category for Panels IPE How would I change the category from "Fielded panes" in Panels IPE to something else?

I can accomplish this through the following code:

function template_preprocess_panels_add_content_modal(&amp;$vars) {
  $i = 0;
  foreach($vars['categories_array'] as $item) {
    $new_item = str_replace("Fielded panes", "New Content", $item);
    $vars['categories_array'][$i] = $new_item;
    $i++;
  }
}


However, I'd like to find a more elegant solution by altering the category name in a function that runs before template_preprocess_panels_add_content_modal().
Have a look at template_preprocess_panels_add_content_modal() and $vars['categories']. You should be able to override the category names there.

Edit:

Ahh, yes, I forgot about hook_ctools_content_subtype_alter(). That's more elegant :)

From the documentation:


  This hook can be used to add things like 'render last' or change icons
  or categories or to rename content on specific sites.


In the example below the category "Fielded panes" is changed to "New category name".

/**
 * Implements hook_ctools_content_subtype_alter().
 */
function MYMODULE_ctools_content_subtype_alter(&amp;$subtype, &amp;$plugin) {
  if ($subtype['category'] == 'Fielded panes') {
    $subtype['category'] = 'New category name';
  }
}