| @@ -1,5 +1,16 @@ | ||
| 1 | 1 | <?php |
| 2 | +/** | |
| 3 | + * Form errors and success message wrapper. | |
| 4 | + * | |
| 5 | + * @package Formidable | |
| 6 | + * | |
| 7 | + * @var stdClass|null $form Form object when available. | |
| 8 | + * @var string|null $message Success message HTML. | |
| 9 | + * @var array|null $errors Field errors keyed by field id. | |
| 10 | + * @var string|null $include_extra_container Optional CSS class for a wrapping container. | |
| 11 | + */ | |
| 12 | + | |
| 2 | 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 3 | 14 | die( 'You are not allowed to call this page directly.' ); |
| 4 | 15 | } |
| 5 | 16 | |
| @@ -16,9 +27,9 @@ | ||
| 16 | 27 | <?php |
| 17 | 28 | } else { |
| 18 | 29 | FrmFormsHelper::maybe_get_scroll_js( $form->id ); |
| 19 | 30 | |
| 20 | - // we need to allow scripts here for javascript in the success message | |
| 31 | + // We need to allow scripts here for javascript in the success message | |
| 21 | 32 | echo FrmAppHelper::maybe_kses( $message ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 22 | 33 | } |
| 23 | 34 | } |
| 24 | 35 | |
| @@ -33,9 +44,9 @@ | ||
| 33 | 44 | |
| 34 | 45 | if ( ! FrmAppHelper::is_admin() ) { |
| 35 | 46 | $img = apply_filters( 'frm_error_icon', $img ); |
| 36 | 47 | |
| 37 | - if ( $img && ! empty( $img ) ) { | |
| 48 | + if ( $img ) { | |
| 38 | 49 | echo '<img src="' . esc_url( $img ) . '" alt="" />'; |
| 39 | 50 | } |
| 40 | 51 | } |
| 41 | 52 | |