GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
field-delete_link-html.php
Go to the documentation of this file.
1 <?php
2 /**
3  * The default delete link field output template.
4  *
5  * @global \GV\Template_Context $gravityview
6  * @since 2.0
7  */
8 
9 if ( ! isset( $gravityview ) || empty( $gravityview->template ) ) {
10  gravityview()->log->error( '{file} template loaded without context', array( 'file' => __FILE__ ) );
11  return;
12 }
13 
14 /** @var \GV\GF_Form $gf_form */
15 $gf_form = isset( $gravityview->field->form_id ) ? \GV\GF_Form::by_id( $gravityview->field->form_id ) : $gravityview->view->form;
16 $form = $gf_form->form;
17 
18 if ( $gravityview->entry->is_multi() ) {
19  $entry = $gravityview->entry->from_field( $gravityview->field );
20  $entry = $entry->as_entry();
21 } else {
22  $entry = $gravityview->entry->as_entry();
23 }
24 
25 $field_settings = $gravityview->field->as_configuration();
26 
27 global $post;
28 
29 if ( ! class_exists( 'GravityView_Delete_Entry' ) ) {
30  return;
31 }
32 
33 // Only show the link to logged-in users with the right caps.
35  return;
36 }
37 
38 $link_text = empty( $field_settings['delete_link'] ) ? __( 'Delete Entry', 'gk-gravityview' ) : $field_settings['delete_link'];
39 
40 $link_text = apply_filters( 'gravityview_entry_link', GravityView_API::replace_variables( $link_text, $form, $entry ), $gravityview );
41 
42 $href = GravityView_Delete_Entry::get_delete_link( $entry, $gravityview->view->ID, $post ? $post->ID : null );
43 
44 $attributes = array(
46 );
47 
static get_delete_link( $entry, $view_id=0, $post_id=null)
Generate a nonce link with the base URL of the current View embed.
gravityview_get_link( $href='', $anchor_text='', $atts=array())
Generate an HTML anchor tag with a list of supported attributes.
static get_confirm_dialog()
Get the onclick attribute for the confirm dialogs that warns users before they delete an entry...
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
static by_id( $form_id)
Construct a instance by ID.
static replace_variables( $text, $form=array(), $entry=array(), $url_encode=false, $esc_html=true, $nl2br=true, $format='html', $aux_data=array())
Alias for GravityView_Merge_Tags::replace_variables()
Definition: class-api.php:118
gravityview()
The main GravityView wrapper function.
$entry
Definition: notes.php:27