function scheduler_api_test_scheduler_hide_publish_on_field in Scheduler 8
Implements hook_scheduler_hide_publish_on_field().
File
- tests/
modules/ scheduler_api_test/ scheduler_api_test.module, line 127 - Hook implementations of the Scheduler API Test module.
Code
function scheduler_api_test_scheduler_hide_publish_on_field($form, $form_state, $node) {
// Hide the publish_on field if the node title contains orange or green.
if (stristr($node->title->value, 'orange') || stristr($node->title->value, 'green')) {
\Drupal::messenger()
->addMessage(t('Scheduler_Api_Test: The publish_on field is hidden for orange or green node titles.'), 'status', FALSE);
return TRUE;
}
else {
return FALSE;
}
}