function photos_form_alter in Album Photos 8.5
Same name and namespace in other branches
- 8.4 photos.module \photos_form_alter()
 - 6.2 photos.module \photos_form_alter()
 - 7.3 photos.module \photos_form_alter()
 - 6.0.x photos.module \photos_form_alter()
 
Implements hook_form_alter().
File
- ./
photos.module, line 820  - Implementation of photos.module.
 
Code
function photos_form_alter(&$form, FormStateInterface &$form_state, $form_id) {
  // Photos node form.
  if ($form_id == 'node_photos_form') {
    foreach (array_keys($form['actions']) as $action) {
      if ($action != 'preview' && isset($form['actions'][$action]['#type']) && $form['actions'][$action]['#type'] === 'submit') {
        $form['actions'][$action]['#submit'][] = 'photos_form_redirect';
      }
    }
  }
}