PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.32.1
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.32.1
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
formidable / classes / views / frm-entries / errors.php

errors.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 6.32.1, at classes/views/frm-entries/errors.php

65 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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
13 if ( ! defined( 'ABSPATH' ) ) {
14 die( 'You are not allowed to call this page directly.' );
15 }
16
17 if ( isset( $include_extra_container ) ) { ?>
18 <div class="<?php echo esc_attr( $include_extra_container ); ?>" id="frm_form_<?php echo esc_attr( $form->id ); ?>_container">
19 <?php
20 }
21
22 // phpcs:ignore Universal.Operators.StrictComparisons
23 if ( isset( $message ) && $message != '' ) {
24 if ( FrmAppHelper::is_admin() ) {
25 ?>
26 <div id="message" class="frm_updated_message" role="status"><?php echo wp_kses_post( $message ); ?></div>
27 <?php
28 } else {
29 FrmFormsHelper::maybe_get_scroll_js( $form->id );
30
31 // We need to allow scripts here for javascript in the success message
32 echo FrmAppHelper::maybe_kses( $message ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
33 }
34 }
35
36 if ( ! empty( $errors ) && is_array( $errors ) ) {
37 if ( isset( $form ) && is_object( $form ) ) {
38 FrmFormsHelper::get_scroll_js( $form->id );
39 }
40 ?>
41 <div class="<?php echo esc_attr( FrmFormsHelper::form_error_class() ); ?>" role="alert">
42 <?php
43 $img = '';
44
45 if ( ! FrmAppHelper::is_admin() ) {
46 $img = apply_filters( 'frm_error_icon', $img );
47
48 if ( $img ) {
49 echo '<img src="' . esc_url( $img ) . '" alt="" />';
50 }
51 }
52
53 FrmFormsHelper::show_errors( compact( 'img', 'errors', 'form' ) );
54
55 ?>
56 </div>
57 <?php
58 }//end if
59
60 if ( isset( $include_extra_container ) ) {
61 ?>
62 </div>
63 <?php
64 }
65