![]() |
GravityView
2.17
The best, easiest way to display Gravity Forms entries on your website.
|
Public Member Functions | |
| __construct () | |
| add_delete_button ( $form=array(), $entry=array(), $view_id=null, $post_id=null) | |
| Add a Delete button to the "#publishing-action" section of the Delete Entry form. More... | |
| add_reserved_arg ( $args) | |
| Adds "delete" to the list of internal reserved query args. More... | |
| add_template_path ( $file_paths) | |
| Include this extension templates path. More... | |
| display_message () | |
| maybe_display_message ( $current_view_id=0) | |
| After processing delete entry, the user will be redirected to the referring View or embedded post/page. More... | |
| maybe_not_visible ( $visible, $field, $view) | |
| Hide the field or not. More... | |
| process_connected_posts ( $entry_id=0, $entry=array()) | |
| Delete or trash a post connected to an entry. More... | |
| process_delete () | |
| Handle the deletion request, if $_GET['action'] is set to "delete". More... | |
| set_entry ( $entry=null) | |
| Make sure there's an entry. More... | |
| user_can_delete_entry ( $entry=array(), $view_id=null) | |
| Check if the user can edit the entry. More... | |
| verify_nonce () | |
| Is the current nonce valid for editing the entry? More... | |
Static Public Member Functions | |
| static | check_user_cap_delete_entry ( $entry, $field=array(), $view=0) |
| checks if user has permissions to view the link or delete a specific entry More... | |
| static | get_confirm_dialog () |
| Get the onclick attribute for the confirm dialogs that warns users before they delete an entry. More... | |
| static | get_delete_link ( $entry, $view_id=0, $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 | |
| $entry | |
| $form | |
| $instances = array() | |
| $is_valid = null | |
| $view_id | |
| const | REDIRECT_TO_MULTIPLE_ENTRIES_VALUE = 1 |
The value of the delete_redirect option when the setting is to redirect to Multiple Entries after delete. More... | |
| const | REDIRECT_TO_URL_VALUE = 2 |
The value of the delete_redirect option when the setting is to redirect to URL. More... | |
Static Public Attributes | |
| static | $file |
| static | $instance |
Private Member Functions | |
| _redirect_and_exit ( $url, $message='', $status='', $safe_redirect=true) | |
| Redirects the user to a URL and exits. More... | |
| add_hooks () | |
| delete_or_trash_entry ( $entry) | |
| get_delete_mode () | |
| Delete mode: permanently delete, or move to trash? More... | |
| load_components ( $component) | |
| Load other files related to Delete Entry functionality. More... | |
Definition at line 22 of file class-delete-entry.php.
| __construct | ( | ) |
Definition at line 50 of file class-delete-entry.php.
References add_hooks(), and load_components().
|
private |
Redirects the user to a URL and exits.
| string | $url | The URL to redirect to. |
| string | $message | Message to pass through URL. |
| string | $status | The deletion status ("deleted", "trashed", or "error"). |
| bool | $safe_redirect | Whether to use wp_safe_redirect() or not. |
gravityview/delete-entry/redirect-args Modify the query args added to the delete entry redirect | array | $delete_redirect_args | Array with _delete_nonce, message and status keys |
Definition at line 412 of file class-delete-entry.php.
References $url.
Referenced by process_delete().
| add_delete_button | ( | $form = array(), |
|
$entry = array(), |
|||
$view_id = null, |
|||
$post_id = null |
|||
| ) |
Add a Delete button to the "#publishing-action" section of the Delete Entry form.
| array | $form | Gravity Forms form array |
| array | $entry | Gravity Forms entry array |
| int | $view_id | GravityView View ID |
| int | $post_id | Current post ID. May be same as View ID. |
gravityview/delete-entry/show-delete-button Should the Delete button be shown in the Edit Entry screen? | boolean | $show_entry | Default: true |
Definition at line 280 of file class-delete-entry.php.
References $attributes, View\by_id(), and gravityview_get_link().
|
private |
| add_reserved_arg | ( | $args | ) |
Adds "delete" to the list of internal reserved query args.
| array | $args | Existing reserved args |
Definition at line 113 of file class-delete-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 181 of file class-delete-entry.php.
|
static |
checks if user has permissions to view the link or delete a specific entry
$view_id param| array | $entry | Gravity Forms entry array |
| array | $field | Field settings (optional) |
| int | \GV\View | $view | Pass a View ID to check caps against. If not set, check against current View ( |
Definition at line 674 of file class-delete-entry.php.
References $field, View\by_id(), GravityView_View\getInstance(), gravityview(), and GVCommon\has_cap().
Referenced by GravityView_Entry_Link_Shortcode\has_cap().
|
private |
GFAPI::delete_entry() GFAPI::update_entry_property()
gravityview/delete-entry/deleted Triggered when an entry is deleted | int | $entry_id | ID of the Gravity Forms entry |
| array | $entry | Deleted entry array |
gravityview/delete-entry/trashed Triggered when an entry is trashed | int | $entry_id | ID of the Gravity Forms entry |
| array | $entry | Deleted entry array |
Definition at line 465 of file class-delete-entry.php.
References get_delete_mode(), gravityview(), and GravityView_Cache.
Referenced by process_delete().
| display_message | ( | ) |
gravityview/delete-entry/message Modify the Delete Entry messages | string | $message | Message to be displayed |
| string | $status | Message status (error or success) |
| string | $message_from_url | The original error message, if any, without the "There was an error deleting the entry:" prefix |
Definition at line 776 of file class-delete-entry.php.
References $class, Utils\_GET(), GVCommon\generate_notice(), and getInstance().
Referenced by maybe_display_message().
|
static |
Get the onclick attribute for the confirm dialogs that warns users before they delete an entry.
onclick attribute gravityview/delete-entry/confirm-text Modify the Delete Entry Javascript confirmation text | string | $confirm | Default: "Are you sure you want to delete this entry? This cannot be undone." |
Definition at line 608 of file class-delete-entry.php.
Referenced by GravityView_Entry_Link_Shortcode\get_link_atts().
|
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 deleted, there would be nothing to return to.
| array | $entry | Gravity Forms entry array |
| int | $view_id | The View id. Not optional since 2.0 |
NULL. gravityview/delete-entry/add_query_args Modify whether to include passed $_GET parameters to the end of the url | bool | $add_query_params | Whether to include passed $_GET parameters to the end of the Delete Link URL. Default: true. |
Definition at line 221 of file class-delete-entry.php.
References $add_query_args, $entry_slug, $url, GravityView_API\directory_link(), GF_Entry\from_entry(), gravityview(), gravityview_get_view_id(), and gv_get_query_args().
Referenced by GravityView_Entry_Link_Shortcode\get_url().
|
private |
Delete mode: permanently delete, or move to trash?
delete or trash gravityview/delete-entry/mode Delete mode: permanently delete, or move to trash? | string | $delete_mode | Delete mode: trash or delete. Default: delete |
Definition at line 445 of file class-delete-entry.php.
Referenced by delete_or_trash_entry().
|
static |
Generate a consistent nonce key based on the Entry ID.
| int | $entry_id | Entry ID |
Definition at line 207 of file class-delete-entry.php.
|
static |
Return the instantiated class object.
Definition at line 126 of file class-delete-entry.php.
Referenced by display_message().
|
private |
Load other files related to Delete Entry functionality.
| $component |
Definition at line 68 of file class-delete-entry.php.
Referenced by __construct().
| maybe_display_message | ( | $current_view_id = 0 | ) |
After processing delete 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 762 of file class-delete-entry.php.
References display_message().
| maybe_not_visible | ( | $visible, | |
| $field, | |||
| $view | |||
| ) |
Hide the field or not.
For non-logged in users. For users that have no delete 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 147 of file class-delete-entry.php.
| process_connected_posts | ( | $entry_id = 0, |
|
$entry = array() |
|||
| ) |
Delete or trash a post connected to an entry.
| int | $entry_id | ID of entry being deleted/trashed |
| array | $entry | Array of the entry being deleted/trashed |
gravityview/delete-entry/delete-connected-post Should posts connected to an entry be deleted when the entry is deleted? | boolean | $delete_post | If trashing an entry, trash the post. If deleting an entry, delete the post. Default: true |
Definition at line 528 of file class-delete-entry.php.
References gravityview().
| process_delete | ( | ) |
Handle the deletion request, if $_GET['action'] is set to "delete".
action=delete from the URLwp_redirect()Definition at line 330 of file class-delete-entry.php.
References $entry_slug, _redirect_and_exit(), View\by_id(), delete_or_trash_entry(), gravityview(), gravityview_get_entry(), and user_can_delete_entry().
| set_entry | ( | $entry = null | ) |
Make sure there's an entry.
| [type] | $entry [description] |
Definition at line 196 of file class-delete-entry.php.
| user_can_delete_entry | ( | $entry = array(), |
|
$view_id = null |
|||
| ) |
Check if the user can edit the entry.
| array | $entry | Gravity Forms entry array |
Definition at line 632 of file class-delete-entry.php.
References gravityview().
Referenced by process_delete().
| verify_nonce | ( | ) |
Is the current nonce valid for editing the entry?
gravityview/delete-entry/verify_nonce Override Delete 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['delete'] holds the nonce value itself. Default: delete_{entry_id} |
Definition at line 579 of file class-delete-entry.php.
| $entry |
Definition at line 26 of file class-delete-entry.php.
Referenced by maybe_not_visible().
|
static |
Definition at line 24 of file class-delete-entry.php.
| $form |
Definition at line 27 of file class-delete-entry.php.
|
static |
Definition at line 25 of file class-delete-entry.php.
| $instances = array() |
Definition at line 36 of file class-delete-entry.php.
| $is_valid = null |
Definition at line 29 of file class-delete-entry.php.
| $view_id |
Definition at line 28 of file class-delete-entry.php.
| const REDIRECT_TO_MULTIPLE_ENTRIES_VALUE = 1 |
The value of the delete_redirect option when the setting is to redirect to Multiple Entries after delete.
Definition at line 42 of file class-delete-entry.php.
Referenced by View_Settings\defaults().
| const REDIRECT_TO_URL_VALUE = 2 |
The value of the delete_redirect option when the setting is to redirect to URL.
Definition at line 48 of file class-delete-entry.php.
Referenced by View_Settings\defaults().