GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes | Private Member Functions
GravityView_Edit_Entry Class Reference

Public Member Functions

 __construct ()
 
 add_reserved_arg ( $args)
 Adds "edit" to the list of internal reserved query args. More...
 
 add_template_path ( $file_paths)
 Include this extension templates path. More...
 
 delete_file ()
 Deletes a file. More...
 
 get_field_blacklist ( $entry=array())
 2.14 Use { More...
 
 get_field_blocklist ( $entry=array())
 Returns array of field types that should not be displayed in Edit Entry. More...
 
 maybe_not_visible ( $visible, $field, $view)
 Hide the field or not. More...
 
 modify_field_blacklist ( $fields=array(), $context=NULL)
 2.14 Use { More...
 
 modify_field_blocklist ( $fields=array(), $context=NULL)
 Edit mode doesn't allow certain field types. More...
 

Static Public Member Functions

static check_user_cap_edit_entry ( $entry, $view=0)
 checks if user has permissions to edit a specific entry More...
 
static get_edit_link ( $entry, $view_id, $post_id=null, $field_values='')
 The edit entry link creates a secure link with a nonce. More...
 
static get_nonce_key ( $view_id, $form_id, $entry_id)
 Return a well formatted nonce key according to GravityView Edit Entry protocol. More...
 
static getInstance ()
 

Data Fields

 $instances = array()
 

Static Public Attributes

static $file
 
static $instance
 

Private Member Functions

 add_hooks ()
 
 addon_specific_hooks ()
 Trigger hooks that are normally run in the admin for Addons, but need to be triggered manually because we're not in the admin. More...
 
 load_components ( $component)
 

Detailed Description

Definition at line 19 of file class-edit-entry.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Definition at line 35 of file class-edit-entry.php.

References add_hooks(), addon_specific_hooks(), and load_components().

Member Function Documentation

◆ add_hooks()

add_hooks ( )
private

Definition at line 82 of file class-edit-entry.php.

Referenced by __construct().

◆ add_reserved_arg()

add_reserved_arg (   $args)

Adds "edit" to the list of internal reserved query args.

Since
2.10
Parameters
array$argsExisting reserved args
Returns
array

Definition at line 109 of file class-edit-entry.php.

References $args.

◆ add_template_path()

add_template_path (   $file_paths)

Include this extension templates path.

Parameters
array$file_pathsList of template paths ordered

Definition at line 173 of file class-edit-entry.php.

◆ addon_specific_hooks()

addon_specific_hooks ( )
private

Trigger hooks that are normally run in the admin for Addons, but need to be triggered manually because we're not in the admin.

Returns
void

Definition at line 120 of file class-edit-entry.php.

Referenced by __construct().

◆ check_user_cap_edit_entry()

static check_user_cap_edit_entry (   $entry,
  $view = 0 
)
static

checks if user has permissions to edit a specific entry

Needs to be used combined with GravityView_Edit_Entry::user_can_edit_entry for maximum security!!

Parameters
array$entryGravity Forms entry array
\GV\View | int$viewID of the view you want to check visibility against {
Since
1.9.2}. Required since 2.0
Returns
bool
Runs Filter:
gravityview/edit_entry/user_can_edit_entry Modify whether user can edit an entry.
Since
1.15 Added $entry and $view_id parameters
Parameters
boolean$user_can_editCan the current user edit the current entry? (Default: false)
array$entryGravity Forms entry array {
Since
1.15}
Parameters
int$view_idID of the view you want to check visibility against {
Since
1.15}

Definition at line 349 of file class-edit-entry.php.

References $entry, $view_id, GVCommon\get_template_setting(), GravityView_View\getInstance(), gravityview(), and GVCommon\has_cap().

Referenced by GravityView_Entry_Link_Shortcode\has_cap(), GravityView_Edit_Entry_Locking\set_lock(), and GravityView_Edit_Entry_Render\user_can_edit_entry().

◆ delete_file()

delete_file ( )

Deletes a file.

Since
2.14.4

GFForms::delete_file()

Definition at line 432 of file class-edit-entry.php.

References getInstance().

◆ get_edit_link()

static get_edit_link (   $entry,
  $view_id,
  $post_id = null,
  $field_values = '' 
)
static

The edit entry link creates a secure link with a nonce.

It also mimics the URL structure Gravity Forms expects to have so that it formats the display of the edit form like it does in the backend, like "You can edit this post from the post page" fields, for example.

Parameters
$entryarray Gravity Forms entry object
$view_idint GravityView view id
$post_idint GravityView Post ID where View may be embedded {
Since
1.9.2}
Parameters
string | array$field_valuesParameters to pass in to the Edit Entry form to prefill data. Uses the same format as Gravity Forms "Allow field to be populated dynamically" {
Since
1.9.2} {
See also
https://www.gravityhelp.com/documentation/article/allow-field-to-be-populated-dynamically/ }
Returns
string

Allow passing params to dynamically populate entry with values

Since
1.9.2
Runs Filter:
gravityview/edit/link Filter the edit URL link.
Since
2.14.6 Added $post param.
Parameters
string$urlThe url.
array$entryThe entry.
\GV\View$viewThe View.
WP_Post|nullWP_Post $post WP post.

Definition at line 208 of file class-edit-entry.php.

References $entry, $url, $view_id, and gv_entry_link().

Referenced by GravityView_Entry_Link_Shortcode\get_url().

◆ get_field_blacklist()

get_field_blacklist (   $entry = array())

2.14 Use {

See also
GravityView_Edit_Entry::get_field_blocklist()}
Since
1.20
Parameters
array$entryGravity Forms entry array
Returns
array Blocklist of field types

Definition at line 294 of file class-edit-entry.php.

References $entry, and get_field_blocklist().

◆ get_field_blocklist()

get_field_blocklist (   $entry = array())

Returns array of field types that should not be displayed in Edit Entry.

Since
2.14
Parameters
array$entryGravity Forms entry array
Returns
array Blocklist of field types

2.14

Runs Filter:
gravityview/edit_entry/field_blocklist Array of fields that should not be displayed in Edit Entry
Since
1.20
Parameters
string[]$fields Array of field type or meta key names (eg: [ "captcha", "payment_status" ] ).
array$entryGravity Forms entry array.

Definition at line 308 of file class-edit-entry.php.

References $entry.

Referenced by get_field_blacklist(), and modify_field_blocklist().

◆ get_nonce_key()

static get_nonce_key (   $view_id,
  $form_id,
  $entry_id 
)
static

Return a well formatted nonce key according to GravityView Edit Entry protocol.

Parameters
$view_idint GravityView view id
$form_idint Gravity Forms form id
$entry_idint Gravity Forms entry id
Returns
string

Definition at line 190 of file class-edit-entry.php.

References $form_id, and $view_id.

Referenced by GravityView_Edit_Entry_Render\setup_vars().

◆ getInstance()

static getInstance ( )
static

◆ load_components()

load_components (   $component)
private

Definition at line 67 of file class-edit-entry.php.

Referenced by __construct().

◆ maybe_not_visible()

maybe_not_visible (   $visible,
  $field,
  $view 
)

Hide the field or not.

For non-logged in users. For users that have no edit rights on any of the current entries.

Parameters
bool$visibleVisible or not.
\GV\Field$fieldThe field.
\GV\View$viewThe View context.
Returns
bool

Definition at line 140 of file class-edit-entry.php.

References $entry, and $field.

◆ modify_field_blacklist()

modify_field_blacklist (   $fields = array(),
  $context = NULL 
)

2.14 Use {

See also
GravityView_Edit_Entry::modify_field_blocklist()}
Parameters
array$fieldsExisting blocklist fields
string | null$contextContext
Returns
array If not edit context, original field blocklist. Otherwise, blocklist including post fields.

Definition at line 259 of file class-edit-entry.php.

References modify_field_blocklist().

◆ modify_field_blocklist()

modify_field_blocklist (   $fields = array(),
  $context = NULL 
)

Edit mode doesn't allow certain field types.

Since
2.14
Parameters
array$fieldsExisting blocklist fields
string | null$contextContext
Returns
array If not edit context, original field blocklist. Otherwise, blocklist including post fields.

Definition at line 274 of file class-edit-entry.php.

References get_field_blocklist().

Referenced by modify_field_blacklist().

Field Documentation

◆ $file

$file
static

◆ $instance

$instance
static

Definition at line 26 of file class-edit-entry.php.

◆ $instances

$instances = array()

Definition at line 32 of file class-edit-entry.php.


The documentation for this class was generated from the following file: