function scheduled_publish_get_fields in Scheduled Publish 8
Same name and namespace in other branches
- 8.2 scheduled_publish.module \scheduled_publish_get_fields()
1 call to scheduled_publish_get_fields()
- scheduled_publish_form_alter in ./
scheduled_publish.module - Implements hook_form_alter
File
- ./
scheduled_publish.module, line 37 - Contains scheduled_publish.module.
Code
function scheduled_publish_get_fields($key) : array {
$fields = \Drupal::service('entity_field.manager')
->getFieldDefinitions('node', $key);
$scheduledFields = [];
foreach ($fields as $fieldName => $field) {
if (strpos($fieldName, 'field_') !== FALSE) {
if ($field
->getType() === 'scheduled_publish') {
$scheduledFields[] = $fieldName;
}
}
}
return $scheduledFields;
}