GravityView
2.17
The best, easiest way to display Gravity Forms entries on your website.
includes
plugin-and-theme-hooks
class-gravityview-plugin-hooks-gravity-perks.php
Go to the documentation of this file.
1
<?php
2
/**
3
* Fix Gravity Perks conflicts with GravityView
4
*
5
* @file class-gravityview-plugin-hooks-gravity-perks.php
6
* @package GravityView
7
* @license GPL2+
8
* @author GravityView <
[email protected]
>
9
* @link https://gravityview.co
10
* @copyright Copyright 2016, Katz Web Services, Inc.
11
*
12
* @since 1.17.5
13
*/
14
15
/**
16
* @inheritDoc
17
* @since 1.17.5
18
*/
19
class
GravityView_Plugin_Hooks_Gravity_Perks
extends
GravityView_Plugin_and_Theme_Hooks
{
20
21
/**
22
* @var string Check for the Gravity Perks class
23
*/
24
protected
$class_name
=
'GravityPerks'
;
25
26
27
/**
28
* Filter the values shown in GravityView frontend
29
*
30
* @since 1.17
31
*/
32
protected
function
add_hooks
() {
33
34
parent::add_hooks();
35
36
add_filter(
'gravityview/edit_entry/form_fields'
, array( $this,
'edit_entry_fix_uid_fields'
) );
37
38
}
39
40
41
/**
42
* Convert Unique ID fields to be Text fields in Edit Entry
43
*
44
* @since 1.17.4
45
*
46
* @param GF_Field[] $fields Array of fields to be shown on the Edit Entry screen
47
*
48
* @return GF_Field[] Array of fields, with any hidden fields replaced with text fields
49
*/
50
public
function
edit_entry_fix_uid_fields
( $fields ) {
51
52
/** @type \GF_Field $field */
53
foreach
( $fields as &
$field
) {
54
if
(
'uid'
=== $field->type ) {
55
56
// Replace GF_Field with GF_Field_Text, copying all the data from $field
57
$field =
new
GF_Field_Text( $field );
58
59
// Everything is copied from $field, so we need to manually set the type
60
$field->type =
'text'
;
61
}
62
}
63
64
return
$fields;
65
}
66
67
}
68
69
new
GravityView_Plugin_Hooks_Gravity_Perks
;
GravityView_Plugin_Hooks_Gravity_Perks
new GravityView_Plugin_Hooks_Gravity_Perks
Definition:
class-gravityview-plugin-hooks-gravity-perks.php:69
GravityView_Plugin_Hooks_Gravity_Perks\edit_entry_fix_uid_fields
edit_entry_fix_uid_fields( $fields)
Convert Unique ID fields to be Text fields in Edit Entry.
Definition:
class-gravityview-plugin-hooks-gravity-perks.php:50
$field
$field
Definition:
search-field-chainedselect.php:29
GravityView_Plugin_Hooks_Gravity_Perks
Definition:
class-gravityview-plugin-hooks-gravity-perks.php:19
GravityView_Plugin_Hooks_Gravity_Perks\$class_name
$class_name
Definition:
class-gravityview-plugin-hooks-gravity-perks.php:24
GravityView_Plugin_and_Theme_Hooks
Abstract class that makes it easy for plugins and themes to register no-conflict scripts and styles...
Definition:
abstract-gravityview-plugin-and-theme-hooks.php:22
GravityView_Plugin_Hooks_Gravity_Perks\add_hooks
add_hooks()
Filter the values shown in GravityView frontend.
Definition:
class-gravityview-plugin-hooks-gravity-perks.php:32