| 1 |
<?php |
| 2 |
if ( isset( $include_extra_container ) ) { ?> |
| 3 |
<div class="<?php echo esc_attr( $include_extra_container ) ?>" id="frm_form_<?php echo esc_attr( $form->id ) ?>_container"> |
| 4 |
<?php |
| 5 |
} |
| 6 |
if ( isset( $message ) && $message != '' ) { |
| 7 |
if ( FrmAppHelper::is_admin() ) { |
| 8 |
?> |
| 9 |
<div id="message" class="frm_updated_message"><?php echo wp_kses_post( $message ) ?></div> |
| 10 |
<?php |
| 11 |
} else { |
| 12 |
FrmFormsHelper::maybe_get_scroll_js( $form->id ); |
| 13 |
|
| 14 |
// we need to allow scripts here for javascript in the success message |
| 15 |
echo $message; // WPCS: XSS ok. |
| 16 |
} |
| 17 |
} |
| 18 |
|
| 19 |
if ( isset( $errors ) && is_array( $errors ) && ! empty( $errors ) ) { |
| 20 |
|
| 21 |
if ( isset( $form ) && is_object( $form ) ) { |
| 22 |
FrmFormsHelper::get_scroll_js( $form->id ); |
| 23 |
} |
| 24 |
?> |
| 25 |
<div class="<?php echo esc_attr( FrmFormsHelper::form_error_class() ) ?>"> |
| 26 |
<?php |
| 27 |
$img = ''; |
| 28 |
if ( ! FrmAppHelper::is_admin() ) { |
| 29 |
$img = apply_filters( 'frm_error_icon', $img ); |
| 30 |
if ( $img && ! empty( $img ) ) { |
| 31 |
echo '<img src="' . esc_url( $img ) . '" alt="" />'; |
| 32 |
} |
| 33 |
} |
| 34 |
|
| 35 |
FrmFormsHelper::show_errors( compact( 'img', 'errors', 'form' ) ); |
| 36 |
|
| 37 |
?> |
| 38 |
</div> |
| 39 |
<?php |
| 40 |
} |
| 41 |
|
| 42 |
if ( isset( $include_extra_container ) ) { |
| 43 |
?> |
| 44 |
</div> |
| 45 |
<?php |
| 46 |
} |
| 47 |
|