PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.0
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.0
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 / models / FrmValidate.php

FrmValidate.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 6.0, at classes/models/FrmValidate.php

56 lines 951 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 die( 'You are not allowed to call this page directly.' );
4 }
5
6 abstract class FrmValidate {
7
8 /**
9 * @var int $form_id
10 */
11 protected $form_id;
12
13 /**
14 * @var object $form
15 */
16 protected $form;
17
18 /**
19 * @param int $form_id
20 */
21 public function __construct( $form_id ) {
22 $this->form_id = $form_id;
23 }
24
25 /**
26 * @return object $form
27 */
28 protected function get_form() {
29 if ( ! isset( $this->form ) ) {
30 $this->form = FrmForm::getOne( $this->form_id );
31 }
32 return $this->form;
33 }
34
35 /**
36 * @return bool
37 */
38 protected function is_option_on() {
39 $form = $this->get_form();
40 $key = $this->get_option_key();
41 return ! empty( $form->options[ $key ] ) && 'off' !== $form->options[ $key ];
42 }
43
44 /**
45 * @return bool
46 */
47 abstract public function validate();
48
49 /**
50 * Track the form option key used for is_option_on function.
51 *
52 * @return string
53 */
54 abstract protected function get_option_key();
55 }
56