You are here

function scheduler_api_test_scheduler_hide_unpublish_on_field in Scheduler 8

Implements hook_scheduler_hide_unpublish_on_field().

File

tests/modules/scheduler_api_test/scheduler_api_test.module, line 141
Hook implementations of the Scheduler API Test module.

Code

function scheduler_api_test_scheduler_hide_unpublish_on_field($form, $form_state, $node) {

  // Hide the publish_on field if the node title contains yellow or green.
  if (stristr($node->title->value, 'yellow') || stristr($node->title->value, 'green')) {
    \Drupal::messenger()
      ->addMessage(t('Scheduler_Api_Test: The unpublish_on field is hidden for yellow or green node titles.'), 'status', FALSE);
    return TRUE;
  }
  else {
    return FALSE;
  }
}