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
formidable / classes / helpers / FrmFieldGdprHelper.php

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

74 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 * @package Formidable
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 die( 'You are not allowed to call this page directly.' );
11 }
12
13 /**
14 * Class FrmFieldGdprHelper
15 */
16 class FrmFieldGdprHelper {
17
18 /**
19 * Field type
20 *
21 * @since 6.19
22 * @var string
23 */
24 const FIELD_TYPE = 'gdpr';
25
26 /**
27 * Field class
28 *
29 * @since 6.19
30 * @var string
31 */
32 const FIELD_CLASS = 'FrmFieldGdpr';
33
34 /**
35 * Hide GDPR field
36 *
37 * @since 6.19
38 * @return bool
39 */
40 public static function hide_gdpr_field() {
41 $settings = FrmAppHelper::get_settings();
42 return ! $settings->enable_gdpr;
43 }
44
45 /**
46 * Add GDPR field to form builder
47 *
48 * @since 6.19
49 * @param array $fields
50 * @return array
51 */
52 public static function add_gdpr_field( $fields ) {
53 $fields[ self::FIELD_TYPE ] = array(
54 'name' => __( 'GDPR', 'formidable' ),
55 'icon' => 'frm_icon_font frm-gdpr-icon',
56 );
57 return $fields;
58 }
59
60 /**
61 * Initialize GDPR field Class name
62 *
63 * @since 6.19
64 * @param string $field_type
65 * @return string
66 */
67 public static function get_gdpr_field_class( $field_type = '' ) {
68 if ( self::FIELD_TYPE === $field_type ) {
69 return self::FIELD_CLASS;
70 }
71 return '';
72 }
73 }
74