drupal 7 工作正常测试。
/**
* Implementation of hook_form_alter().
*/
function MY_MODULE_form_alter(&$form, &$form_state, $form_id) {
switch ($form_id) {
case 'form_id':
$form['actions']['submit']['#submit'][] = 'MY_MODULE_custom_submit';
break;
}
}
function MY_MODULE_custom_submit($form, &$form_state)
{
//Get current messages and clear them.
$messages = drupal_get_messages('status');
drupal_set_message(t('Your custom status message here!'));
}