![]() |
GravityView
2.17
The best, easiest way to display Gravity Forms entries on your website.
|
Public Member Functions | |
| __construct () | |
| _filter_sortable_fields ( $fields) | |
| Prevent users from being able to sort by the Duplicate field. More... | |
| add_available_field ( $available_fields=array()) | |
| Add Duplicate Entry Link to the Add Field dialog. More... | |
| add_default_field ( $entry_default_fields, $form=array(), $zone='') | |
| Add Edit Link as a default field, outside those set in the Gravity Form form. More... | |
| add_reserved_arg ( $args) | |
| Adds "duplicate" to the list of internal reserved query args. More... | |
| add_template_path ( $file_paths) | |
| Include this extension templates path. More... | |
| display_message () | |
| duplicate_link_field_options ( $field_options, $template_id, $field_id, $context, $input_type) | |
| Add "Duplicate Link Text" setting to the edit_link field settings. More... | |
| make_duplicate_link_row ( $form_id, $field_id, $value, $entry, $query_string) | |
| Add a Duplicate link to the row of actions on the entry list in the backend. More... | |
| maybe_display_message ( $current_view_id=0) | |
| After processing duplicate entry, the user will be redirected to the referring View or embedded post/page. More... | |
| maybe_duplicate_list ( $form_id) | |
| Perhaps duplicate this entry if the action has been corrected. More... | |
| maybe_not_visible ( $visible, $field, $view) | |
| Hide the field or not. More... | |
| modify_visibility_caps ( $visibility_caps=array(), $template_id='', $field_id='', $context='', $input_type='') | |
| Change wording for the Edit context to read Entry Creator. More... | |
| process_duplicate () | |
| Handle the duplication request, if $_GET['action'] is set to "duplicate". More... | |
| verify_nonce () | |
| Is the current nonce valid for editing the entry? More... | |
Static Public Member Functions | |
| static | check_user_cap_duplicate_entry ( $entry, $field=array(), $view_id=0) |
| checks if user has permissions to view the link or duplicate a specific entry More... | |
| static | get_confirm_dialog () |
| Get the onclick attribute for the confirm dialogs that warns users before they duplicate an entry. More... | |
| static | get_duplicate_link ( $entry, $view_id, $post_id=null) |
| Generate a nonce link with the base URL of the current View embed. More... | |
| static | get_nonce_key ( $entry_id) |
| Generate a consistent nonce key based on the Entry ID. More... | |
| static | getInstance () |
| Return the instantiated class object. More... | |
Data Fields | |
| $view_id | |
Static Public Attributes | |
| static | $file |
| static | $instance |
Private Member Functions | |
| add_hooks () | |
| duplicate_entry ( $entry) | |
| Duplicate the entry. More... | |
| user_can_duplicate_entry ( $entry=array(), $view_id=null) | |
| Check if the user can edit the entry. More... | |
Definition at line 22 of file class-duplicate-entry.php.
| __construct | ( | ) |
Definition at line 36 of file class-duplicate-entry.php.
References add_hooks().
| _filter_sortable_fields | ( | $fields | ) |
Prevent users from being able to sort by the Duplicate field.
| array | $fields | Array of field types not editable by users |
Definition at line 156 of file class-duplicate-entry.php.
| add_available_field | ( | $available_fields = array() | ) |
Add Duplicate Entry Link to the Add Field dialog.
| array | $available_fields |
duplicate_link added Definition at line 259 of file class-duplicate-entry.php.
| add_default_field | ( | $entry_default_fields, | |
$form = array(), |
|||
$zone = '' |
|||
| ) |
Add Edit Link as a default field, outside those set in the Gravity Form form.
| array | $entry_default_fields | Existing fields |
| string | array | $form | form_ID or form object |
| string | $zone | Either 'single', 'directory', 'edit', 'header', 'footer' |
duplicate_link added. Won't be added if in Edit Entry context. Definition at line 236 of file class-duplicate-entry.php.
|
private |
| add_reserved_arg | ( | $args | ) |
Adds "duplicate" to the list of internal reserved query args.
| array | $args | Existing reserved args |
Definition at line 84 of file class-duplicate-entry.php.
References $args.
| add_template_path | ( | $file_paths | ) |
Include this extension templates path.
| array | $file_paths | List of template paths ordered |
Definition at line 174 of file class-duplicate-entry.php.
|
static |
checks if user has permissions to view the link or duplicate a specific entry
| array | $entry | Gravity Forms entry array |
| array | $field | Field settings (optional) |
| int | $view_id | Pass a View ID to check caps against. If not set, check against current View |
Definition at line 658 of file class-duplicate-entry.php.
References $entry, $field, gravityview(), and GVCommon\has_cap().
| display_message | ( | ) |
gravityview/duplicate-entry/message Modify the Duplicate Entry messages. Allows HTML; will not be further sanitized. | string | $message | Message to be displayed, sanitized using esc_attr() |
| string | $status | Message status (error or success) |
| string | $message_from_url | The original error message, if any, without the "There was an error duplicating the entry:" prefix |
Definition at line 760 of file class-duplicate-entry.php.
References $class, and Utils\_GET().
Referenced by maybe_display_message().
|
private |
Duplicate the entry.
Done after all the checks in self::process_duplicate.
| array | $entry | The entry to be duplicated |
gravityview/entry/duplicate/details Modify the new entry details before it's created. | array | $row | The entry details |
| array | $entry | The original entry |
gravityview/entry/duplicate/meta Modify the new entry meta details. | array | $save_this_meta | The duplicate meta. Use/add meta_key, meta_value, item_index. |
| array | $row | The duplicated entry |
| array | $entry | The original entry |
gravityview/duplicate-entry/duplicated Triggered when an entry is duplicated | array | $duplicated_entry | The duplicated entry |
| array | $entry | The original entry |
Definition at line 456 of file class-duplicate-entry.php.
References $entry, GV\$form, Utils\_SERVER(), and gravityview().
Referenced by maybe_duplicate_list(), and process_duplicate().
| duplicate_link_field_options | ( | $field_options, | |
| $template_id, | |||
| $field_id, | |||
| $context, | |||
| $input_type | |||
| ) |
Add "Duplicate Link Text" setting to the edit_link field settings.
| array | $field_options | [description] |
| [type] | $template_id [description] | |
| [type] | $field_id [description] | |
| [type] | $context [description] | |
| [type] | $input_type [description] |
Definition at line 196 of file class-duplicate-entry.php.
References $field_id, and GravityView_Render_Settings\get_cap_choices().
|
static |
Get the onclick attribute for the confirm dialogs that warns users before they duplicate an entry.
onclick attribute gravityview/duplicate-entry/confirm-text Modify the Duplicate Entry Javascript confirmation text (will be sanitized when output)| string | $confirm | Default: "Are you sure you want to duplicate this entry?". If empty, disable confirmation dialog. |
Definition at line 592 of file class-duplicate-entry.php.
|
static |
Generate a nonce link with the base URL of the current View embed.
We don't want to link to the single entry, because when duplicated, there would be nothing to return to.
| array | $entry | Gravity Forms entry array |
| int | $view_id | The View id. Not optional since 2.0 |
| int | $post_id | ID of the current post/page being embedded on, if any |
NULL. Definition at line 329 of file class-duplicate-entry.php.
References $entry, GravityView_API\directory_link(), and gravityview().
|
static |
Generate a consistent nonce key based on the Entry ID.
| int | $entry_id | Entry ID |
Definition at line 311 of file class-duplicate-entry.php.
|
static |
Return the instantiated class object.
Definition at line 97 of file class-duplicate-entry.php.
Referenced by maybe_duplicate_list().
| make_duplicate_link_row | ( | $form_id, | |
| $field_id, | |||
| $value, | |||
| $entry, | |||
| $query_string | |||
| ) |
Add a Duplicate link to the row of actions on the entry list in the backend.
| int | $form_id | The form ID. |
| int | $field_id | The field ID. |
| string | $value | The value. |
| array | $entry | The entry. |
| string | $query_string | The query. |
gravityview/duplicate/backend/enable Disables the duplicate link on the backend. | boolean | $enable | True by default. Enabled. |
| int | $form_id | The form ID. |
Definition at line 807 of file class-duplicate-entry.php.
References $form_id.
| maybe_display_message | ( | $current_view_id = 0 | ) |
After processing duplicate entry, the user will be redirected to the referring View or embedded post/page.
Display a message on redirection.
If success, there will be status URL parameters status=>success If an error, there will be status and message URL parameters status=>error&message=example
| int | $current_view_id | The ID of the View being rendered |
Definition at line 747 of file class-duplicate-entry.php.
References display_message().
| maybe_duplicate_list | ( | $form_id | ) |
Perhaps duplicate this entry if the action has been corrected.
| int | $form_id | The form ID. |
Definition at line 835 of file class-duplicate-entry.php.
References $entry, duplicate_entry(), getInstance(), gravityview(), and GVCommon\has_cap().
| maybe_not_visible | ( | $visible, | |
| $field, | |||
| $view | |||
| ) |
Hide the field or not.
For non-logged in users. For users that have no duplicate rights on any of the current entries.
| bool | $visible | Visible or not. |
| \GV\Field | $field | The field. |
| \GV\View | $view | The View context. |
Definition at line 118 of file class-duplicate-entry.php.
| modify_visibility_caps | ( | $visibility_caps = array(), |
|
$template_id = '', |
|||
$field_id = '', |
|||
$context = '', |
|||
$input_type = '' |
|||
| ) |
Change wording for the Edit context to read Entry Creator.
| array | $visibility_caps | Array of capabilities to display in field dropdown. |
| string | $field_type | Type of field options to render (field or widget) |
| string | $template_id | Table slug |
| float | string | $field_id | GF Field ID - Example: 3, 5.2, entry_link, created_by |
| string | $context | What context are we in? Example: single or directory |
| string | $input_type | (textarea, list, select, etc.) |
label, value, type, default keys Definition at line 286 of file class-duplicate-entry.php.
References $field_id.
| process_duplicate | ( | ) |
Handle the duplication request, if $_GET['action'] is set to "duplicate".
action=duplicate from the URLwp_safe_redirect()wp_safe_redirect()
Definition at line 363 of file class-duplicate-entry.php.
References $entry, $entry_slug, duplicate_entry(), gravityview(), gravityview_get_entry(), and user_can_duplicate_entry().
|
private |
Check if the user can edit the entry.
| array | $entry | Gravity Forms entry array |
| int | $view_id | ID of the View being rendered |
Definition at line 624 of file class-duplicate-entry.php.
References gravityview().
Referenced by process_duplicate().
| verify_nonce | ( | ) |
Is the current nonce valid for editing the entry?
gravityview/duplicate-entry/verify_nonce Override Duplicate Entry nonce validation. Return true to declare nonce valid. | int | boolean | $valid | False if invalid; 1 or 2 when nonce was generated |
| string | $nonce_key | Name of nonce action used in wp_verify_nonce. $_GET['duplicate'] holds the nonce value itself. Default: duplicate_{entry_id} |
Definition at line 562 of file class-duplicate-entry.php.
|
static |
Definition at line 27 of file class-duplicate-entry.php.
|
static |
Definition at line 32 of file class-duplicate-entry.php.
| $view_id |
Definition at line 34 of file class-duplicate-entry.php.