You are here

function hook_scheduler_hide_unpublish_on_field in Scheduler 8

Hook function to hide the Unpublish On field.

This hook is called from scheduler_form_node_form_alter(). It gives modules the ability to hide the scheduler unpublish_on input field on the node edit form. Note that it does not give the ability to force the field to be displayed, as that could override a more significant setting. It can only be used to hide the field.

This hook was introduced for scheduler_content_moderation_integration.

Parameters

array $form: An associative array containing the structure of the form, as used in hook_form_alter().

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form, as used in hook_form_alter().

\Drupal\node\NodeInterface $node: The $node object of the node being editted.

Return value

bool TRUE to hide the unpublish_on field. FALSE or NULL to leave the setting unchanged.

See also

https://www.drupal.org/project/scheduler/issues/2798689

1 function implements hook_scheduler_hide_unpublish_on_field()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

scheduler_api_test_scheduler_hide_unpublish_on_field in tests/modules/scheduler_api_test/scheduler_api_test.module
Implements hook_scheduler_hide_unpublish_on_field().

File

./scheduler.api.php, line 175
API documentation for the Scheduler module.

Code

function hook_scheduler_hide_unpublish_on_field(array $form, FormStateInterface $form_state, NodeInterface $node) {
  return FALSE;
}