PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.22
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.22
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/models/FrmValidate.php +16 -5 6.4.26.22 View file →
@@ -5,18 +5,24 @@
5 5
6 6 abstract class FrmValidate {
7 7
8 8 /**
9 - * @var int $form_id
9 + * @var int
10 10 */
11 11 protected $form_id;
12 12
13 13 /**
14 - * @var object $form
14 + * @var object
15 15 */
16 16 protected $form;
17 17
18 18 /**
19 + * @since 6.21
20 + * @var string
21 + */
22 + protected $option_type = 'form';
23 +
24 + /**
19 25 * @param int $form_id
20 26 */
21 27 public function __construct( $form_id ) {
22 28 $this->form_id = $form_id;
@@ -25,9 +31,9 @@
25 31 /**
26 32 * @return object $form
27 33 */
28 34 protected function get_form() {
29 - if ( ! isset( $this->form ) ) {
35 + if ( empty( $this->form ) ) {
30 36 $this->form = FrmForm::getOne( $this->form_id );
31 37 }
32 38 return $this->form;
33 39 }
@@ -35,15 +41,20 @@
35 41 /**
36 42 * @return bool
37 43 */
38 44 protected function is_option_on() {
45 + $key = $this->get_option_key();
46 + if ( 'global' === $this->option_type ) {
47 + $frm_settings = FrmAppHelper::get_settings();
48 + return ! empty( $frm_settings->$key );
49 + }
50 +
39 51 $form = $this->get_form();
40 - $key = $this->get_option_key();
41 52 return ! empty( $form->options[ $key ] ) && 'off' !== $form->options[ $key ];
42 53 }
43 54
44 55 /**
45 - * @return bool
56 + * @return bool|string
46 57 */
47 58 abstract public function validate();
48 59
49 60 /**