When a node is saved, the Location Taxonomize module by default prints a message if terms are created. This message is very confusing for my users so I want to remove it.
I found where the message is being displayed in the module's code:
/**
* @param $items - an array of items ready to be taxonomized
*/
function location_taxonomize_taxonomize($items, $form, &$form_state) {
$saved = 0;
$tids = array();
foreach ($items as $item) {
$results = location_taxonomize_process_item($item);
$saved += $results['saved'];
$tids = array_merge($tids, $results['tids']);
}
if (!empty($tids)) {
if (location_taxonomize_term_attach_enabled()) {
location_taxonomize_term_attach($tids, $form, $form_state);
}
}
$msg = t('Location taxonomize: @num new terms saved', array('@num' => $saved));
drupal_set_message($msg);
return array("saved" => $saved, "tids" => $tids);
}
Obviously I could just delete the line drupal_set_message($msg);
but then I would have to do this every update and I would eventually forget. I'm still learning how to use hooks and I know that hooks can be used to remove form elements but what about status messages? Is it possible to stop the message from being displayed using hooks and if so, could you please give me some pointers about how to go about doing so?