I am using Foundation as my main theme and am using hook_form_alter to add a class to every form:

function mysite_form_alter(&$form, &$form_state, $form_id) {
  $form['#attributes']['class'][] = 'custom';
}

But this gives me an error when I try to save New Custom Content or a Fieldable Panel Pane. "An error occurred while attempting to process...Cannot read property "field' of undefined..."

I wish to write an If statement so that I can test to see if I am on this form and therefore not try to add the class. My problem is that I can not figure out what ID I can use that will address this form, both for New Custom Content and Fieldable Panel panes when using the PIE.

When I go through the UI to create this content all works fine, but when using the PIE the form looks a little different, I just can't figure out how to address it. Thanks!