| @@ -1,17 +1,8 @@ | ||
| 1 | 1 | <?php defined( 'ABSPATH' ) or exit; |
| 2 | 2 | |
| 3 | -$tabs = array( | |
| 4 | - 'fields' => __( 'Fields', 'html-forms' ), | |
| 5 | - 'messages' => __( 'Messages', 'html-forms' ), | |
| 6 | - 'settings' => __( 'Settings', 'html-forms' ), | |
| 7 | - 'actions' => __( 'Actions', 'html-forms' ), | |
| 8 | -); | |
| 3 | +$tabs = hf_get_admin_tabs($form); | |
| 9 | 4 | |
| 10 | -if( $settings['save_submissions'] ) { | |
| 11 | - $tabs['submissions'] = __( 'Submissions', 'html-forms' ); | |
| 12 | -} | |
| 13 | - | |
| 14 | 5 | ?> |
| 15 | 6 | <script>document.title = 'Edit form' + ' - ' + document.title;</script> |
| 16 | 7 | <div class="wrap hf"> |
| 17 | 8 | |
| @@ -22,14 +13,15 @@ | ||
| 22 | 13 | </p> |
| 23 | 14 | |
| 24 | 15 | <h1 class="page-title"><?php _e( 'Edit form', 'html-forms' ); ?></h1> |
| 25 | 16 | |
| 26 | - <?php if ( ! empty( $_GET['saved'] ) ) { | |
| 17 | + <?php if ( ! empty( $_GET['saved'] ) ) { | |
| 27 | 18 | echo '<div class="notice notice-success"><p>' . __( 'Form updated.', 'html-forms' ) . '</p></div>'; |
| 28 | 19 | } ?> |
| 29 | 20 | |
| 30 | 21 | <form method="post"> |
| 31 | 22 | <input type="hidden" name="_hf_admin_action" value="save_form" /> |
| 23 | + <input type="hidden" name="_wpnonce" value="<?php echo esc_attr( wp_create_nonce('_hf_admin_action') ); ?>" /> | |
| 32 | 24 | <input type="hidden" name="form_id" value="<?php echo esc_attr( $form->ID ); ?>" /> |
| 33 | 25 | <input type="submit" style="display: none; " /> |
| 34 | 26 | |
| 35 | 27 | <div id="titlediv"> |