PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
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
← All changes | classes/widgets/FrmShowForm.php +19 -8 6.4.2 → trunk View file →
@@ -9,28 +9,35 @@
9 9 $widget_ops = array( 'description' => __( 'Display a Formidable Form', 'formidable' ) );
10 10 parent::__construct( 'frm_show_form', __( 'Formidable Form', 'formidable' ), $widget_ops );
11 11 }
12 12
13 + /**
14 + * @param array $args
15 + * @param array $instance
16 + *
17 + * @return void
18 + */
13 19 public function widget( $args, $instance ) {
14 - $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
20 + $title = apply_filters( 'widget_title', ! empty( $instance['title'] ) ? $instance['title'] : '', $instance, $this->id_base );
15 21
16 - echo FrmAppHelper::kses( $args['before_widget'], 'all' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
22 + FrmAppHelper::kses_echo( $args['before_widget'], 'all' );
17 23
18 24 echo '<div class="frm_form_widget">';
25 +
19 26 if ( $title ) {
20 - echo FrmAppHelper::kses( $args['before_title'] . stripslashes( $title ) . $args['after_title'], 'all' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
27 + FrmAppHelper::kses_echo( $args['before_title'] . stripslashes( $title ) . $args['after_title'], 'all' );
21 28 }
22 29
23 30 $form_atts = array(
24 - 'id' => isset( $instance['form'] ) ? $instance['form'] : 0,
31 + 'id' => $instance['form'] ?? 0,
25 32 'title' => false,
26 - 'description' => isset( $instance['description'] ) ? $instance['description'] : false,
33 + 'description' => $instance['description'] ?? false,
27 34 );
28 35
29 36 echo FrmFormsController::get_form_shortcode( $form_atts ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
30 37
31 38 echo '</div>';
32 - echo FrmAppHelper::kses( $args['after_widget'], 'all' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
39 + FrmAppHelper::kses_echo( $args['after_widget'], 'all' );
33 40 }
34 41
35 42 /**
36 43 * @param array $new_instance New settings for this instance as input by the user via
@@ -35,8 +42,9 @@
35 42 /**
36 43 * @param array $new_instance New settings for this instance as input by the user via
37 44 * WP_Widget::form().
38 45 * @param array $old_instance Old settings for this instance.
46 + *
39 47 * @return array Settings to save or bool false to cancel saving.
40 48 */
41 49 public function update( $new_instance, $old_instance ) {
42 50 return $new_instance;
@@ -45,8 +53,9 @@
45 53 /**
46 54 * Outputs the settings update form.
47 55 *
48 56 * @param array $instance Current settings.
57 + *
49 58 * @return string Default return is 'noform'.
50 59 */
51 60 public function form( $instance ) {
52 61 $defaults = array(
@@ -53,9 +62,10 @@
53 62 'title' => false,
54 63 'form' => false,
55 64 'description' => false,
56 65 );
57 - $instance = wp_parse_args( (array) $instance, $defaults );
66 + $instance = wp_parse_args( $instance, $defaults );
67 + // phpcs:disable Generic.WhiteSpace.ScopeIndent
58 68 ?>
59 69 <p>
60 70 <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>">
61 71 <?php esc_html_e( 'Title', 'formidable' ); ?>:
@@ -91,7 +101,8 @@
91 101 <?php esc_html_e( 'Show Description', 'formidable' ); ?>
92 102 </label>
93 103 </p>
94 104 <?php
95 - return 'noform';
105 + // phpcs:enable Generic.WhiteSpace.ScopeIndent
106 + return '';
96 107 }
97 108 }