function scheduler_api_test_scheduler_hide_publish_date in Scheduler 2.x
Implements hook_scheduler_hide_publish_date().
File
- tests/
modules/ scheduler_api_test/ scheduler_api_test.module, line 312 - Hook implementations of the Scheduler API Test module.
Code
function scheduler_api_test_scheduler_hide_publish_date($form, $form_state, $entity) {
// Hide the publish_on field if the title contains 'orange {type}'.
if (stristr($entity
->label(), "orange {$entity->getEntityTypeId()}")) {
\Drupal::messenger()
->addMessage(t('Scheduler_Api_Test: The publish_on field is hidden for orange.'), 'status', FALSE);
return TRUE;
}
else {
return FALSE;
}
}