You are here

function publication_date_pubdate_submit in Publication Date 7.2

Same name and namespace in other branches
  1. 7 publication_date.module \publication_date_pubdate_submit()

Node edit form submit handler.

Convert the published date to Epoch time for other hook implementations to deal with.

1 string reference to 'publication_date_pubdate_submit'
publication_date_form_node_form_alter in ./publication_date.module
Implements hook_form_BASE_ID_alter().

File

./publication_date.module, line 242
Add a field to nodes containing the publication date.

Code

function publication_date_pubdate_submit($form, &$form_state) {

  // Set $node->published_at to the publication date field value if it was set,
  // or NULL if it was not.
  $form_state['node']->published_at = empty($form_state['values']['pubdate']) ? NULL : strtotime($form_state['values']['pubdate']);
}