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