PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.33
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.33
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 / helpers / FrmFieldGdprHelper.php

FrmFieldGdprHelper.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 6.33, at classes/helpers/FrmFieldGdprHelper.php

78 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * GDPR field helper
4 *
5 * @since 6.19
6 *
7 * @package Formidable
8 */
9
10 if ( ! defined( 'ABSPATH' ) ) {
11 die( 'You are not allowed to call this page directly.' );
12 }
13
14 /**
15 * Class FrmFieldGdprHelper
16 */
17 class FrmFieldGdprHelper {
18
19 /**
20 * Field type
21 *
22 * @since 6.19
23 *
24 * @var string
25 */
26 const FIELD_TYPE = 'gdpr';
27
28 /**
29 * Field class
30 *
31 * @since 6.19
32 *
33 * @var string
34 */
35 const FIELD_CLASS = 'FrmFieldGdpr';
36
37 /**
38 * Hide GDPR field
39 *
40 * @since 6.19
41 *
42 * @return bool
43 */
44 public static function hide_gdpr_field() {
45 return ! FrmAppHelper::get_settings()->enable_gdpr;
46 }
47
48 /**
49 * Add GDPR field to form builder
50 *
51 * @since 6.19
52 *
53 * @param array $fields
54 *
55 * @return array
56 */
57 public static function add_gdpr_field( $fields ) {
58 $fields[ self::FIELD_TYPE ] = array(
59 'name' => __( 'GDPR', 'formidable' ),
60 'icon' => 'frmfont frm-gdpr-icon',
61 );
62 return $fields;
63 }
64
65 /**
66 * Initialize GDPR field Class name
67 *
68 * @since 6.19
69 *
70 * @param string $field_type
71 *
72 * @return string
73 */
74 public static function get_gdpr_field_class( $field_type = '' ) {
75 return self::FIELD_TYPE === $field_type ? self::FIELD_CLASS : '';
76 }
77 }
78