Display Custom Message on Node Save - D7

By Default, each time you created a new node, you will be shown a message saying something like "node {title} has been created". To override this message, with your own, you can do it programmatically from your own custom module. In your custom module .module file, you add an implementation of hook_form_alter(), as below.

/**
* Implements hook_form_alter().
*/
function custom_module_form_alter(&$form, &$form_state, $form_id){
    switch($form_id) {
      case 'article_node_form':
        $form['actions']['submit']['#submit'][] = 'article_after_submission';
        break;
    }   
}

/**
* Additional callback for when an article node type is saved.
*/
function article_after_submission($form, &$form_state) {
  //Unset all messages with type 'status' that had already been added to the queue, this is including the default drupal message
  drupal_get_messages('status', $clear_queue = TRUE); 

  //Set your own custom message here
  drupal_set_message(t('Custom Message!'));
}

 

Note: You can use this technique to do anything else you wish to happen after a node save. For example, sending out email notifications, etc.