title: Drupal 7 - Attempting to add custom validation to all node edit forms
body: <p>I want to add custom validation to all node edit forms. Specifically, will make any image field <strong>alt</strong> and <strong>title</strong> attributes required. But I haven't even gotten to that piece yet.  So far, I have the following code, but for some reason my validation helper function is never called:</p>
  
  <pre><code>&lt;?php
  
  /*
   * Implements hook_form_alter()
   */
  function image_a11y_form_alter($form, &amp;$form_state, &amp;$form_id) {
  
    // Do this for ALL node edit forms (not specific form ID)
    if (isset($form['#node_edit_form']) &amp;&amp;  $form['#node_edit_form'] == TRUE) {
      $form['#validate'][] = 'custom_validate';
    }
  }
  
  function custom_validate($form, &amp;$form_state){
  
    // Custom validation here
  
  }
  </code></pre>
  
  <p>I've followed several examples I found online and double checked the Drupal.org API doc. I don't know what I'm doing wrong.</p>