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