function publication_date_pubdate_submit in Publication Date 7
Same name and namespace in other branches
- 7.2 publication_date.module \publication_date_pubdate_submit()
Node edit form submit handler.
Update the published date to Epoch integer 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 - Implementation of hook_form_BASE_ID_alter().
File
- ./
publication_date.module, line 158 - 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 zero if it was not.
$form_state['node']->published_at = empty($form_state['values']['pubdate']) ? 0 : strtotime($form_state['values']['pubdate']);
}