You are here

function scheduled_publish_is_supported_edit_form in Scheduled Publish 8.2

1 call to scheduled_publish_is_supported_edit_form()
scheduled_publish_form_alter in ./scheduled_publish.module
Implements hook_form_alter

File

./scheduled_publish.module, line 29
Contains scheduled_publish.module.

Code

function scheduled_publish_is_supported_edit_form() : bool {
  $currentPath = \Drupal::service('path.current')
    ->getPath();
  foreach (ScheduledPublishCron::$supportedTypes as $supportedType) {
    if (is_numeric(strpos($currentPath, '/' . explode('_', $supportedType)[0] . '/')) && (is_numeric(strpos($currentPath, '/add')) || is_numeric(strpos($currentPath, '/edit')))) {
      return TRUE;
    }
  }
  return FALSE;
}