function publication_date_entity_property_info_alter in Publication Date 7.2
Implements hook_entity_property_info_alter().
File
- ./
publication_date.module, line 297 - Add a field to nodes containing the publication date.
Code
function publication_date_entity_property_info_alter(&$info) {
$properties =& $info['node']['properties'];
$properties['published_at'] = array(
'label' => t('Published at'),
'description' => t('The publication date of the node.'),
'type' => 'date',
'getter callback' => '_publication_date_published_at_getter',
'setter callback' => '_publication_date_published_at_setter',
'setter permission' => 'set any published on date',
);
$properties['published_at_or_now'] = array(
'label' => t('Published at or now'),
'description' => t('The publication date of the node, or the current time if no publication date is set.'),
'type' => 'date',
'getter callback' => '_publication_date_published_at_or_now_getter',
);
$properties['published_at_or_changed'] = array(
'label' => t('Published at or now'),
'description' => t('The publication date of the node, or the time it was last changed if no publication date is set.'),
'type' => 'date',
'getter callback' => '_publication_date_published_at_or_changed_getter',
);
$properties['published_at_or_created'] = array(
'label' => t('Published at or now'),
'description' => t('The publication date of the node, or the time it was created if no publication date is set.'),
'type' => 'date',
'getter callback' => '_publication_date_published_at_or_created_getter',
);
}