GravityView  1.22.6
The best, easiest way to display Gravity Forms entries on your website.
form-buttons.php
Go to the documentation of this file.
1 <?php
2 /**
3  * @file form-buttons.php
4  * @global GravityView_Edit_Entry_Render $object
5  */
6 ?>
7 <div id="publishing-action">
8  <?php
9 
10  /**
11  * @filter `gravityview/edit_entry/cancel_link` Modify the cancel button link URL
12  * @since 1.11.1
13  * @param string $back_link Existing URL of the Cancel link
14  * @param array $form The Gravity Forms form
15  * @param array $entry The Gravity Forms entry
16  * @param int $view_id The current View ID
17  */
18  $back_link = apply_filters( 'gravityview/edit_entry/cancel_link', remove_query_arg( array( 'page', 'view', 'edit' ) ), $object->form, $object->entry, $object->view_id );
19 
20  /**
21  * @action `gravityview/edit-entry/publishing-action/before` Triggered before the submit buttons in the Edit Entry screen, inside the `<div id="publishing-action">` container.
22  * @since 1.5.1
23  * @param array $form The Gravity Forms form
24  * @param array $entry The Gravity Forms entry
25  * @param int $view_id The current View ID
26  */
27  do_action( 'gravityview/edit-entry/publishing-action/before', $object->form, $object->entry, $object->view_id );
28 
29 
30  $labels = array(
31  'cancel' => __( 'Cancel', 'gravityview' ),
32  'submit' => __( 'Update', 'gravityview')
33  );
34 
35  /**
36  * @filter `gravityview/edit_entry/button_labels` Modify the cancel/submit buttons' labels
37  * @since 1.16.3
38  * @param array $labels Default button labels associative array
39  * @param array $form The Gravity Forms form
40  * @param array $entry The Gravity Forms entry
41  * @param int $view_id The current View ID
42  */
43  $labels = apply_filters( 'gravityview/edit_entry/button_labels', $labels, $object->form, $object->entry, $object->view_id );
44 
45  $update_tabindex = GFCommon::get_tabindex();
46  $cancel_tabindex = GFCommon::get_tabindex();
47  ?>
48  <input id="gform_submit_button_<?php echo esc_attr( $object->form['id'] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-update" type="submit" <?php echo $update_tabindex; ?> value="<?php echo esc_attr( $labels['submit'] ); ?>" name="save" />
49 
50  <a class="btn btn-sm button button-small gv-button-cancel" <?php echo $cancel_tabindex; ?> href="<?php echo esc_url( $back_link ); ?>"><?php echo esc_attr( $labels['cancel'] ); ?></a>
51  <?php
52 
53  /**
54  * @action `gravityview/edit-entry/publishing-action/after` Triggered after the submit buttons in the Edit Entry screen, inside the `<div id="publishing-action">` container.
55  * @since 1.5.1
56  * @param array $form The Gravity Forms form
57  * @param array $entry The Gravity Forms entry
58  * @param int $view_id The current View ID
59  */
60  do_action( 'gravityview/edit-entry/publishing-action/after', $object->form, $object->entry, $object->view_id );
61 
62  ?>
63  <input type="hidden" name="action" value="update" />
64  <input type="hidden" name="lid" value="<?php echo esc_attr( $object->entry['id'] ); ?>" />
65 </div>
$labels
$back_link
$cancel_tabindex
$update_tabindex