When you need to find the child items present in a form, you need to use element_children(), as Drupal functions like filter_process_format() do.  

The reason is simple: In a Drupal form array, as well as in a render array, not all the keys are child items; those keys with a name that starts with # are properties. Consider, for example, the form returned from forum_form_forum(); if you loop through it with the following code, you would add values where you should not.

foreach($form as $key =&gt; $value) {
  $form[$key]['#attributes']['class'][] = 'vr-paragraphs';
}


In fact, $form['#submit'] is not a child item, nor is $form['#theme']. In particular, when your code will be executed for the last key, you would get a PHP error. $form['#theme'] is a string, and $form['#theme']['#attributes'] would select a character of that string, supposing that '#attributes' would be evaluated as the integer 0; even in that case, $form['#theme']['#attributes']['class'][] would not be a valid PHP construct.

The correct code would be the following one.

foreach(element_children($form) as $key) {
  $form[$key]['#attributes']['class'][] = 'vr-paragraphs';
}


Theming Form Fields: Alter all fields
If I have 7 lands and a Wild Cantor (or another creature that sacrifices to produce mana, e.g. an Eldrazi Spawn token) in play, and there are no other creatures on the battlefield, can I cast Blasphemous Act?  

I seem to have hazy memories that a Wild Cantor didn't interact particularly well with cards with Convoke, so I was wondering if it was a similar story here...
