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/FrmElementorWidget.php +33 -6 6.4.1 → trunk View file →
@@ -5,24 +5,39 @@
5 5
6 6 if ( class_exists( '\Elementor\Widget_Base' ) ) {
7 7 class FrmElementorWidget extends \Elementor\Widget_Base {
8 8
9 + /**
10 + * @return string
11 + */
9 12 public function get_name() {
10 13 return 'formidable';
11 14 }
12 15
16 + /**
17 + * @return string
18 + */
13 19 public function get_title() {
14 20 return FrmAppHelper::get_menu_name() . ' ' . __( 'Forms', 'formidable' );
15 21 }
16 22
23 + /**
24 + * @return string
25 + */
17 26 public function get_icon() {
18 27 return FrmAppHelper::get_menu_icon_class();
19 28 }
20 29
30 + /**
31 + * @return array
32 + */
21 33 public function get_categories() {
22 34 return array( 'general' );
23 35 }
24 36
37 + /**
38 + * @return void
39 + */
25 40 protected function register_controls() {
26 41 $this->start_controls_section(
27 42 'section_form_dropdown',
28 43 array(
@@ -56,8 +71,14 @@
56 71
57 72 $this->end_controls_section();
58 73 }
59 74
75 + /**
76 + * @param string $key
77 + * @param string $title
78 + *
79 + * @return void
80 + */
60 81 private function add_basic_switcher_control( $key, $title ) {
61 82 $this->add_control(
62 83 $key,
63 84 array(
@@ -66,8 +87,11 @@
66 87 )
67 88 );
68 89 }
69 90
91 + /**
92 + * @return array
93 + */
70 94 private function get_form_options() {
71 95 $query = array();
72 96 $where = apply_filters( 'frm_forms_dropdown', $query, 'form' );
73 97 $forms = FrmForm::get_published_forms( $where, 999, 'exclude' );
@@ -73,9 +97,9 @@
73 97 $forms = FrmForm::get_published_forms( $where, 999, 'exclude' );
74 98 $options = array( '' => '' );
75 99
76 100 foreach ( $forms as $form ) {
77 - $form_title = '' === $form->name ? __( '(no title)', 'formidable' ) : FrmAppHelper::truncate( $form->name, 50 );
101 + $form_title = '' === $form->name ? FrmFormsHelper::get_no_title_text() : FrmAppHelper::truncate( $form->name, 50 );
78 102 $options[ $form->id ] = esc_html( $form_title );
79 103 }
80 104
81 105 return $options;
@@ -80,8 +104,11 @@
80 104
81 105 return $options;
82 106 }
83 107
108 + /**
109 + * @return void
110 + */
84 111 protected function render() {
85 112 $settings = $this->get_settings_for_display();
86 113 $form_id = isset( $settings['form_id'] ) ? absint( $settings['form_id'] ) : 0;
87 114 $title = isset( $settings['title'] ) && 'yes' === $settings['title'];
@@ -90,13 +117,13 @@
90 117
91 118 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
92 119 echo FrmFormsController::get_form_shortcode(
93 120 array(
94 - 'id' => $form_id,
95 - 'title' => $title,
96 - 'description' => $description,
97 - 'minimize' => $minimize,
121 + 'id' => $form_id, // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
122 + 'title' => $title, // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
123 + 'description' => $description, // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
124 + 'minimize' => $minimize, // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
98 125 )
99 126 );
100 127 }
101 128 }
102 -}
129 +}//end if