GravityView
2.17
The best, easiest way to display Gravity Forms entries on your website.
|
Public Member Functions | |
__construct (GravityView_Edit_Entry $loader) | |
custom_validation ( $validation_results) | |
Make validation work for Edit Entry. More... | |
edit_entry_form () | |
Display the Edit Entry form. More... | |
filter_modify_form_fields ( $form, $ajax=false, $field_values='') | |
Modify the form fields that are shown when using GFFormDisplay::get_form() More... | |
fix_multiselect_value_serialization ( $field_value, $field, $_this) | |
Multiselect in GF 2.2 became a json_encoded value. More... | |
get_action_labels () | |
Returns labels for the action links on Edit Entry. More... | |
get_entry () | |
TODO: This seems to be hacky... More... | |
gform_pre_validation ( $form) | |
Add field keys that Gravity Forms expects. More... | |
init ( $gv_data=null, $entry=null, $view=null, $request=null) | |
Load required files and trigger edit flow. More... | |
is_edit_entry () | |
Is the current page an Edit Entry page? More... | |
is_edit_entry_submission () | |
Is the current page an Edit Entry page? More... | |
load () | |
manage_conditional_logic ( $has_conditional_logic, $form) | |
Disable the Gravity Forms conditional logic script and features on the Edit Entry screen. More... | |
modify_fileupload_settings ( $plupload_init, $form_id, $instance) | |
Remove max_files validation (done on gravityforms.js) to avoid conflicts with GravityView Late validation done on self::custom_validation. More... | |
prevent_maybe_process_form () | |
Because we're mimicking being a front-end Gravity Forms form while using a Gravity Forms backend form, we need to prevent them from saving twice. More... | |
prevent_render_form () | |
Don't show any forms embedded on a page when GravityView is in Edit Entry mode. More... | |
prevent_update_unapproved_meta ( $value, $form, $entry) | |
Done once from self::preset_approval_fields. More... | |
render_form_buttons () | |
Display the Update/Cancel/Delete buttons for the Edit Entry form. More... | |
save_field_value ( $value='', $entry=array(), $field=null, $form=array(), $input_id='') | |
Make sure the fileuploads are not overwritten if no such request was done. More... | |
verify_nonce () | |
Is the current nonce valid for editing the entry? More... | |
verify_user_can_edit_post ( $field_content='', $field=null, $value='', $lead_id=0, $form_id=0) | |
When displaying a field, check if it's a Post Field, and if so, make sure the post exists and current user has edit rights. More... | |
Data Fields | |
$entry | |
$fields_with_calculation = array() | |
$form | |
$form_after_validation = null | |
$form_id | |
$is_paged_submitted | |
$is_valid = NULL | |
$post_id | |
$show_next_button | |
$show_previous_button | |
$show_update_button | |
$view | |
$view_id | |
Static Public Attributes | |
static | $nonce_key |
Protected Attributes | |
$loader | |
Private Member Functions | |
after_update () | |
Perform actions normally performed after updating a lead. More... | |
check_user_cap_edit_field ( $field) | |
checks if user has permissions to edit a specific field More... | |
fill_post_template ( $template, $form, $entry, $do_shortcode=false) | |
Convert a field content template into prepared output. More... | |
filter_admin_only_fields ( $fields=array(), $edit_fields=null, $form=array(), $view_id=0) | |
Remove fields that shouldn't be visible based on the Gravity Forms adminOnly field property. More... | |
filter_conditional_logic ( $form) | |
Remove the conditional logic rules from the form button and the form fields, if needed. More... | |
form_prepare_for_save () | |
Set visibility to visible and convert field input key to string. More... | |
get_configured_edit_fields ( $form, $view_id) | |
Get the Edit Entry fields as configured in the View. More... | |
get_field_value ( $field) | |
Modify the value for the current field input. More... | |
maybe_print_message () | |
Display success or error message if the form has been submitted. More... | |
maybe_update_post_fields ( $form) | |
Loop through the fields being edited and if they include Post fields, update the Entry's post object. More... | |
merge_field_properties ( $field, $field_setting) | |
Override GF Form field properties with the ones defined on the View. More... | |
preset_approval_fields () | |
Leverage gravityview/approve_entries/update_unapproved_meta to prevent the missing/empty approval field to affect is_approved meta at all. More... | |
print_scripts () | |
Force Gravity Forms to output scripts as if it were in the admin. More... | |
process_save ( $gv_data) | |
Process edit entry form save. More... | |
process_save_process_files ( $form_id) | |
Have GF handle file uploads. More... | |
render_edit_form () | |
Display the Edit Entry form in the original Gravity Forms format. More... | |
setup_vars ( $view, $entry) | |
When Edit entry view is requested, set up key class variables. More... | |
unselect_default_values ( $form) | |
Checkboxes and other checkbox-based controls should not display default checks in edit mode. More... | |
unset_hidden_field_values () | |
Delete the value of fields hidden by conditional logic when the entry is edited. More... | |
update_calculation_fields () | |
update_post_image ( $form, $field, $field_id, $value, $entry, $post_id) | |
Handle updating the Post Image field. More... | |
user_can_edit_entry ( $echo=false) | |
Check if the user can edit the entry. More... | |
user_can_edit_field ( $field, $echo=false) | |
Check whether a field is editable by the current user, and optionally display an error message GravityView_Edit_Entry->check_user_cap_edit_field() Check user capabilities. More... | |
validate () | |
Process validation for a edit entry submission. More... | |
Static Private Attributes | |
static | $nonce_field = 'is_gv_edit_entry' |
static | $original_entry = array() |
static | $original_form |
static | $supports_save_and_continue = false |
Definition at line 16 of file class-edit-entry-render.php.
__construct | ( | GravityView_Edit_Entry | $loader | ) |
Definition at line 131 of file class-edit-entry-render.php.
References $loader.
|
private |
Perform actions normally performed after updating a lead.
Maybe process feeds.
Definition at line 998 of file class-edit-entry-render.php.
References $entry, and $field.
Referenced by process_save().
|
private |
checks if user has permissions to edit a specific field
Needs to be used combined with GravityView_Edit_Entry::user_can_edit_field for maximum security!!
[type] | $field [description] |
Definition at line 2436 of file class-edit-entry-render.php.
References $field, and GVCommon\has_cap().
Referenced by user_can_edit_field().
custom_validation | ( | $validation_results | ) |
Make validation work for Edit Entry.
Because we're calling the GFFormDisplay::validate() in an unusual way (as a front-end form pretending to be a back-end form), validate() doesn't know we can't edit post fields. This goes through all the fields and if they're an invalid post field, we set them as valid. If there are still issues, we'll return false.
$validation_results | { bool $is_valid array $form int $failed_validation_page The page number which has failed validation. } |
Definition at line 1758 of file class-edit-entry-render.php.
References $entry, $field, $value, get_entry(), and gravityview().
edit_entry_form | ( | ) |
Display the Edit Entry form.
Fixes weird wpautop() issue
gravityview_edit_entry_title
Modify the edit entry title string | $edit_entry_title | Modify the "Edit Entry" title |
GravityView_Edit_Entry_Render | $this | This object |
Definition at line 1059 of file class-edit-entry-render.php.
References GravityView_Edit_Entry\$file, $view, View\by_id(), gravityview_ob_include(), gravityview_strip_whitespace(), maybe_print_message(), and render_edit_form().
Referenced by init().
|
private |
Convert a field content template into prepared output.
GravityView_GFFormsModel::get_post_field_images()
string | $template | The content template for the field |
array | $form | Gravity Forms form |
bool | $do_shortcode | Whether to process shortcode inside content. In GF, only run on Custom Field and Post Content fields |
Definition at line 968 of file class-edit-entry-render.php.
References $entry, $form, $output, $template, GravityView_GFFormsModel\get_post_field_images(), and GRAVITYVIEW_DIR.
Referenced by maybe_update_post_fields().
|
private |
Remove fields that shouldn't be visible based on the Gravity Forms adminOnly field property.
array|GF_Field[] | $fields Gravity Forms form fields | |
array | null | $edit_fields | Fields for the Edit Entry tab configured in the View Configuration |
array | $form | GF Form array |
int | $view_id | View ID |
gravityview/edit_entry/use_gf_admin_only_setting
When Edit tab isn't configured, should the Gravity Forms "Admin Only" field settings be used to control field display to non-admins? Default: true If the Edit Entry tab is not configured, adminOnly fields will not be shown to non-administrators. If the Edit Entry tab is configured, adminOnly fields will be shown to non-administrators, using the configured GV permissions boolean | $use_gf_adminonly_setting | True: Hide field if set to Admin Only in GF and the user is not an admin. False: show field based on GV permissions, ignoring GF permissions. |
array | $form | GF Form array |
int | $view_id | View ID |
Definition at line 2085 of file class-edit-entry-render.php.
References $field, $form, $view_id, and GVCommon\has_cap().
Referenced by get_configured_edit_fields().
|
private |
Remove the conditional logic rules from the form button and the form fields, if needed.
array | $form | Gravity Forms form |
Fields that are tied to a conditional logic field that is not present in the view have to still be displayed, if the condition is met.
This conditional field is not editable in this View. We need to remove the rule, but only if it matches.
Normalize the indices...
gravityview/edit_entry/conditional_logic
Should the Edit Entry form use Gravity Forms conditional logic showing/hiding of fields? bool | $use_conditional_logic | True: Gravity Forms will show/hide fields just like in the original form; False: conditional logic will be disabled and fields will be shown based on configuration. Default: true |
array | $form | Gravity Forms form |
Definition at line 2217 of file class-edit-entry-render.php.
References $field, $form, GV\$i, $value, and gravityview().
Referenced by filter_modify_form_fields(), and form_prepare_for_save().
filter_modify_form_fields | ( | $form, | |
$ajax = false , |
|||
$field_values = '' |
|||
) |
Modify the form fields that are shown when using GFFormDisplay::get_form()
By default, all fields will be shown. We only want the Edit Tab configured fields to be shown.
array | $form | |
boolean | $ajax | Whether in AJAX mode |
array | string | $field_values | Passed parameters to the form |
Definition at line 1384 of file class-edit-entry-render.php.
References $form, $form_after_validation, filter_conditional_logic(), get_configured_edit_fields(), and unselect_default_values().
fix_multiselect_value_serialization | ( | $field_value, | |
$field, | |||
$_this | |||
) |
Multiselect in GF 2.2 became a json_encoded value.
Fix it.
As a hack for now we'll implode it back.
Definition at line 2490 of file class-edit-entry-render.php.
References $field, and $field_value.
|
private |
Set visibility to visible and convert field input key to string.
GF_Field $field
Remove the fields with calculation formulas before save to avoid conflicts with GF logic
Definition at line 645 of file class-edit-entry-render.php.
References $field, $form, and filter_conditional_logic().
Referenced by process_save().
get_action_labels | ( | ) |
Returns labels for the action links on Edit Entry.
cancel
, submit
, next
, previous
array keys with associated labels. gravityview/edit_entry/button_labels
Modify the cancel/submit buttons' labels array | $labels | Default button labels associative array |
array | $form | The Gravity Forms form |
array | $entry | The Gravity Forms entry |
int | $view_id | The current View ID |
Definition at line 2511 of file class-edit-entry-render.php.
References $labels.
|
private |
Get the Edit Entry fields as configured in the View.
int | $view_id |
gravityview/edit_entry/form_fields
Modify the fields displayed in Edit Entry form GF_Field[] | $fields Gravity Forms form fields | |
array | null | $edit_fields | Fields for the Edit Entry tab configured in the View Configuration |
array | $form | GF Form array (fields key modified to have only fields configured to show in Edit Entry) |
int | $view_id | View ID |
Definition at line 1919 of file class-edit-entry-render.php.
References $field, $form, $view, $view_id, View\by_id(), filter_admin_only_fields(), and merge_field_properties().
Referenced by filter_modify_form_fields(), update_calculation_fields(), and validate().
get_entry | ( | ) |
TODO: This seems to be hacky...
we should remove it. Entry is set when updating the form using setup_vars()! Get the current entry and set it if it's not yet set.
Definition at line 1896 of file class-edit-entry-render.php.
References $entry, gravityview_get_entry(), and GravityView_frontend\is_single_entry().
Referenced by custom_validation(), and gform_pre_validation().
|
private |
Modify the value for the current field input.
GF_Field | $field |
gravityview/edit_entry/pre_populate/override
Allow the pre-populated value to override saved value in Edit Entry form. By default, pre-populate mechanism only kicks on empty fields. boolean | True: override saved values; False: don't override (default) |
$field | GF_Field object Gravity Forms field object |
gravityview/edit_entry/field_value
Change the value of an Edit Entry field, if needed mixed | $field_value | field value used to populate the input |
object | $field | Gravity Forms field object ( Class GF_Field ) |
GravityView_Edit_Entry_Render | $this | Current object |
gravityview/edit_entry/field_value_{field_type}
Change the value of an Edit Entry field for a specific field type mixed | $field_value | field value used to populate the input |
GF_Field | $field | Gravity Forms field object |
GravityView_Edit_Entry_Render | $this | Current object |
Definition at line 1516 of file class-edit-entry-render.php.
References $field, $field_value, $input_id, and gv_empty().
Referenced by verify_user_can_edit_post().
gform_pre_validation | ( | $form | ) |
Add field keys that Gravity Forms expects.
array | $form | GF Form |
this whole fileupload hack is because in the admin, Gravity Forms simply doesn't update any fileupload field if it's empty, but it DOES in the frontend.
What we have to do is set the value so that it doesn't get overwritten as empty on save and appears immediately in the Edit Entry screen again.
Definition at line 1607 of file class-edit-entry-render.php.
References $entry, $field, $form, $form_id, $value, get_entry(), and verify_nonce().
init | ( | $gv_data = null , |
|
$entry = null , |
|||
$view = null , |
|||
$request = null |
|||
) |
Load required files and trigger edit flow.
Run when the is_edit_entry returns true.
\GravityView_View_Data | $gv_data | GravityView Data object |
\GV\Entry | $entry | The Entry. |
\GV\View | $view | The View. |
\GV\Request | $request | The Request. |
Definition at line 278 of file class-edit-entry-render.php.
References $entry, $view, edit_entry_form(), GravityView_View_Data\getInstance(), gravityview(), print_scripts(), process_save(), setup_vars(), user_can_edit_entry(), and verify_nonce().
is_edit_entry | ( | ) |
Is the current page an Edit Entry page?
Definition at line 209 of file class-edit-entry-render.php.
References gravityview(), is_edit_entry_submission(), and GravityView_frontend\is_single_entry().
Referenced by manage_conditional_logic(), modify_fileupload_settings(), prevent_render_form(), and verify_nonce().
is_edit_entry_submission | ( | ) |
Is the current page an Edit Entry page?
Definition at line 223 of file class-edit-entry-render.php.
Referenced by is_edit_entry(), prevent_maybe_process_form(), verify_nonce(), and verify_user_can_edit_post().
load | ( | ) |
"GRAVITYVIEW_DIR" "../../../"
Definition at line 135 of file class-edit-entry-render.php.
References GRAVITYVIEW_DIR.
manage_conditional_logic | ( | $has_conditional_logic, | |
$form | |||
) |
Disable the Gravity Forms conditional logic script and features on the Edit Entry screen.
$has_conditional_logic | |
$form |
Definition at line 2306 of file class-edit-entry-render.php.
References $form, and is_edit_entry().
|
private |
Display success or error message if the form has been submitted.
gravityview/features/paged-edit
bool | $enable_paged_edit | Should paged editing be supported? |
array | $form | The current form connected to the entry being edited |
gravityview/edit_entry/button_labels
Modify the cancel/submit buttons' labels array | $labels | Default button labels associative array |
array | $form | The Gravity Forms form |
array | $entry | The Gravity Forms entry |
int | $view_id | The current View ID |
gravityview/edit_entry/page/success
Modify the edit entry success message on pages string | $entry_updated_message | Existing message |
int | $view_id | View ID |
array | $entry | Gravity Forms entry array |
gravityview/edit_entry/success
Modify the edit entry success message (including the anchor link)string | $entry_updated_message | Existing message |
int | $view_id | View ID |
array | $entry | Gravity Forms entry array |
string | $back_link | URL to return to the original entry. |
string | null | $redirect_url | URL to return to after the update. |
Definition at line 1138 of file class-edit-entry-render.php.
References $back_link, $labels, $view, Utils\_POST(), View\by_id(), GravityView_API\directory_link(), and GVCommon\generate_notice().
Referenced by edit_entry_form().
|
private |
Loop through the fields being edited and if they include Post fields, update the Entry's post object.
array | $form | Gravity Forms form |
Definition at line 839 of file class-edit-entry-render.php.
References $entry, $field, $field_id, $form, $post_id, $value, fill_post_template(), gravityview(), GVCommon\has_cap(), and update_post_image().
Referenced by process_save().
|
private |
Override GF Form field properties with the ones defined on the View.
GF_Field | $field | GF Form field object |
array | $field_setting | GV field options |
Normalize page numbers - avoid conflicts with page validation
Definition at line 2049 of file class-edit-entry-render.php.
References $field.
Referenced by get_configured_edit_fields().
modify_fileupload_settings | ( | $plupload_init, | |
$form_id, | |||
$instance | |||
) |
Remove max_files validation (done on gravityforms.js) to avoid conflicts with GravityView Late validation done on self::custom_validation.
$plupload_init | array Plupload settings |
$form_id | |
$instance |
Definition at line 630 of file class-edit-entry-render.php.
References is_edit_entry().
|
private |
Leverage gravityview/approve_entries/update_unapproved_meta
to prevent the missing/empty approval field to affect is_approved meta at all.
Called before the Gravity Forms after_update triggers.
Definition at line 507 of file class-edit-entry-render.php.
References $field.
Referenced by process_save().
prevent_maybe_process_form | ( | ) |
Because we're mimicking being a front-end Gravity Forms form while using a Gravity Forms backend form, we need to prevent them from saving twice.
Definition at line 190 of file class-edit-entry-render.php.
References gravityview(), and is_edit_entry_submission().
prevent_render_form | ( | ) |
Don't show any forms embedded on a page when GravityView is in Edit Entry mode.
Adds a __return_empty_string
filter on the Gravity Forms shortcode on the wp_head
action And then removes it on the wp_footer
action
Definition at line 175 of file class-edit-entry-render.php.
References is_edit_entry().
prevent_update_unapproved_meta | ( | $value, | |
$form, | |||
$entry | |||
) |
Done once from self::preset_approval_fields.
Definition at line 544 of file class-edit-entry-render.php.
References $entry, $value, and GravityView_Entry_Approval_Status\UNAPPROVED.
|
private |
Force Gravity Forms to output scripts as if it were in the admin.
Definition at line 318 of file class-edit-entry-render.php.
References $gravityview_view, and GravityView_View\getInstance().
Referenced by init().
|
private |
Process edit entry form save.
GravityView_View_Data | $gv_data | The View data. |
This step is needed to unset the adminOnly from form fields, to add the calculation fields
to avoid the capability validation of the method save_lead for GF 1.9+
gravityview/edit_entry/before_update
Perform an action before the entry has been updated using Edit Entry array | $form | Gravity Forms form array |
string | $entry_id | Numeric ID of the entry that is being updated |
GravityView_Edit_Entry_Render | $this | This object |
GravityView_View_Data | $gv_data | The View data |
Must be AFTER after_update()!
gravityview/edit_entry/after_update
Perform an action after the entry has been updated using Edit Entry array | $form | Gravity Forms form array |
string | $entry_id | Numeric ID of the entry that was updated |
GravityView_Edit_Entry_Render | $this | This object |
GravityView_View_Data | $gv_data | The View data |
Definition at line 341 of file class-edit-entry-render.php.
References $form, after_update(), form_prepare_for_save(), gravityview(), maybe_update_post_fields(), preset_approval_fields(), process_save_process_files(), unset_hidden_field_values(), update_calculation_fields(), validate(), and verify_nonce().
Referenced by init().
|
private |
Have GF handle file uploads.
Copy of code from GFFormDisplay::process_form()
int | $form_id |
Make sure the fileuploads are not overwritten if no such request was done.
Definition at line 565 of file class-edit-entry-render.php.
References $form_id.
Referenced by process_save().
|
private |
Display the Edit Entry form in the original Gravity Forms format.
gravityview/edit-entry/render/before
Before rendering the Edit Entry form GravityView_Edit_Entry_Render | $this |
gravityview/edit_entry/button_labels
Modify the cancel/submit buttons' labels array | $labels | Default button labels associative array |
array | $form | The Gravity Forms form |
array | $entry | The Gravity Forms entry |
int | $view_id | The current View ID |
gravityview/edit-entry/render/after
After rendering the Edit Entry form GravityView_Edit_Entry_Render | $this |
Definition at line 1255 of file class-edit-entry-render.php.
References $form, and $labels.
Referenced by edit_entry_form().
render_form_buttons | ( | ) |
Display the Update/Cancel/Delete buttons for the Edit Entry form.
Definition at line 1366 of file class-edit-entry-render.php.
References GravityView_Edit_Entry\$file, and gravityview_ob_include().
save_field_value | ( | $value = '' , |
|
$entry = array() , |
|||
$field = null , |
|||
$form = array() , |
|||
$input_id = '' |
|||
) |
Make sure the fileuploads are not overwritten if no such request was done.
TO ONLY BE USED INTERNALLY; DO NOT DEVELOP ON; MAY BE REMOVED AT ANY TIME.
string | $value | Field value |
array | $entry | GF entry array |
GF_Field_FileUpload | $field | |
array | $form | GF form array |
string | $input_id | ID of the input being saved |
No file is being uploaded.
So return the original upload, with $value as backup (it can be empty during edit form rendering)
Definition at line 597 of file class-edit-entry-render.php.
|
private |
When Edit entry view is requested, set up key class variables.
\GV\View | $view | The View. |
\GV\Entry | $entry | The Entry. |
Definition at line 237 of file class-edit-entry-render.php.
References $entries, $entry, $gravityview_view, $post, $view, Utils\get(), GravityView_Edit_Entry\get_nonce_key(), and GravityView_View\getInstance().
Referenced by init().
|
private |
Checkboxes and other checkbox-based controls should not display default checks in edit mode.
https://github.com/gravityview/GravityView/1149
array | $form | Gravity Forms array object |
Definition at line 2126 of file class-edit-entry-render.php.
References $field, $field_id, $field_value, $form, $input_id, $value, and Utils\get().
Referenced by filter_modify_form_fields().
|
private |
Delete the value of fields hidden by conditional logic when the entry is edited.
GFFormsModel::update_lead_field_value()
gravityview/edit_entry/unset_hidden_field_values
Whether to delete values of fields hidden by conditional logic bool | $unset_hidden_field_values | Default: true |
GravityView_Edit_Entry_Render | $this | This object |
Definition at line 437 of file class-edit-entry-render.php.
References $entry, $field, $field_value, $form, $input_id, and GravityView_GFFormsModel\get_database_version().
Referenced by process_save().
|
private |
Definition at line 674 of file class-edit-entry-render.php.
References $entry, $field, $field_id, $form, $input_id, get_configured_edit_fields(), and GravityView_GFFormsModel\get_database_version().
Referenced by process_save().
|
private |
Handle updating the Post Image field.
Sets a new Featured Image if configured in Gravity Forms; otherwise uploads/updates media
GFFormsModel::media_handle_upload set_post_thumbnail
array | $form | GF Form array |
GF_Field | $field | GF Field |
string | $field_id | Numeric ID of the field |
string | $value | |
array | $entry | GF Entry currently being edited |
int | $post_id | ID of the Post being edited |
todo: As soon as ::media_handle_upload becomes a public method, move this call to ::media_handle_upload and remove the hack from this class. Note: the method became public in GF 1.9.17.7, but we don't require that version yet.
Definition at line 758 of file class-edit-entry-render.php.
References $ary, $entry, $field, $field_id, $form, $image_meta, $post_id, $value, Utils\get(), GRAVITYVIEW_DIR, and GravityView_GFFormsModel\media_handle_upload().
Referenced by maybe_update_post_fields().
|
private |
Check if the user can edit the entry.
boolean | $echo | Show error messages in the form? |
If the Entry is embedded, there may be two entries on the same page. If that's the case, and one is being edited, the other should fail gracefully and not display an error.
Definition at line 2331 of file class-edit-entry-render.php.
References GravityView_Edit_Entry\check_user_cap_edit_entry(), GVCommon\generate_notice(), GravityView_oEmbed\getInstance(), gravityview(), gravityview_get_link(), and verify_nonce().
Referenced by init().
|
private |
Check whether a field is editable by the current user, and optionally display an error message GravityView_Edit_Entry->check_user_cap_edit_field() Check user capabilities.
array | $field | Field or field settings array |
boolean | $echo | Whether to show error message telling user they aren't allowed |
Definition at line 2404 of file class-edit-entry-render.php.
References $field, check_user_cap_edit_field(), GVCommon\generate_notice(), and gravityview().
|
private |
Process validation for a edit entry submission.
Sets the is_valid
object var
If using GF User Registration Add-on, remove the validation step, otherwise generates error when updating the entry GF User Registration Add-on version > 3.x has a different class name
For some crazy reason, Gravity Forms doesn't validate Edit Entry form submissions. You can enter whatever you want! We try validating, and customize the results using self::custom_validation()
Definition at line 1704 of file class-edit-entry-render.php.
References get_configured_edit_fields().
Referenced by process_save().
verify_nonce | ( | ) |
Is the current nonce valid for editing the entry?
gravityview/edit_entry/verify_nonce
Override Edit Entry nonce validation. Return true to declare nonce valid. int | boolean | $valid | False if invalid; 1 or 2 when nonce was generated |
string | $nonce_field | Key used when validating submissions. Default: is_gv_edit_entry |
Definition at line 2457 of file class-edit-entry-render.php.
References is_edit_entry(), and is_edit_entry_submission().
Referenced by gform_pre_validation(), init(), process_save(), and user_can_edit_entry().
verify_user_can_edit_post | ( | $field_content = '' , |
|
$field = null , |
|||
$value = '' , |
|||
$lead_id = 0 , |
|||
$form_id = 0 |
|||
) |
When displaying a field, check if it's a Post Field, and if so, make sure the post exists and current user has edit rights.
string | $field_content | Always empty. Returning not-empty overrides the input. |
GF_Field | $field | |
string | array | $value | If array, it's a field with multiple inputs. If string, single input. |
int | $lead_id | Lead ID. Always 0 for the gform_field_input filter. |
int | $form_id | Form ID |
gravityview/edit_entry/no_post_text
Modify the message when someone is editing an entry attached to a post that no longer exists string | $message | The existing "This field is not editable; the post no longer exists." text |
gravityview/edit_entry/unsupported_post_field_text
Modify the message when someone isn't able to edit a post string | $message | The existing "You don't have permission..." text |
Definition at line 1424 of file class-edit-entry-render.php.
References $field, $field_value, $form_id, $gv_field, $value, GravityView_Fields\get_associated_field(), get_field_value(), gravityview(), and is_edit_entry_submission().
$entry |
Definition at line 45 of file class-edit-entry-render.php.
Referenced by after_update(), custom_validation(), fill_post_template(), get_entry(), gform_pre_validation(), init(), maybe_update_post_fields(), prevent_update_unapproved_meta(), save_field_value(), setup_vars(), unset_hidden_field_values(), update_calculation_fields(), and update_post_image().
$fields_with_calculation = array() |
Definition at line 87 of file class-edit-entry-render.php.
$form |
Definition at line 67 of file class-edit-entry-render.php.
Referenced by fill_post_template(), filter_admin_only_fields(), filter_conditional_logic(), filter_modify_form_fields(), form_prepare_for_save(), get_configured_edit_fields(), gform_pre_validation(), manage_conditional_logic(), maybe_update_post_fields(), process_save(), render_edit_form(), unselect_default_values(), unset_hidden_field_values(), update_calculation_fields(), and update_post_image().
$form_after_validation = null |
Definition at line 81 of file class-edit-entry-render.php.
Referenced by filter_modify_form_fields().
$form_id |
Definition at line 94 of file class-edit-entry-render.php.
Referenced by gform_pre_validation(), process_save_process_files(), and verify_user_can_edit_post().
$is_paged_submitted |
Definition at line 129 of file class-edit-entry-render.php.
$is_valid = NULL |
Definition at line 117 of file class-edit-entry-render.php.
|
protected |
Definition at line 21 of file class-edit-entry-render.php.
Referenced by __construct().
|
staticprivate |
Definition at line 32 of file class-edit-entry-render.php.
|
static |
Definition at line 26 of file class-edit-entry-render.php.
|
staticprivate |
Definition at line 60 of file class-edit-entry-render.php.
|
staticprivate |
Definition at line 74 of file class-edit-entry-render.php.
$post_id |
Definition at line 110 of file class-edit-entry-render.php.
Referenced by maybe_update_post_fields(), and update_post_image().
$show_next_button |
Definition at line 127 of file class-edit-entry-render.php.
$show_previous_button |
Definition at line 126 of file class-edit-entry-render.php.
$show_update_button |
Definition at line 128 of file class-edit-entry-render.php.
|
staticprivate |
Definition at line 38 of file class-edit-entry-render.php.
$view |
Definition at line 53 of file class-edit-entry-render.php.
Referenced by edit_entry_form(), get_configured_edit_fields(), init(), maybe_print_message(), and setup_vars().
$view_id |
Definition at line 101 of file class-edit-entry-render.php.
Referenced by filter_admin_only_fields(), and get_configured_edit_fields().