Move create form to only show in list
This commit is contained in:
@@ -24,23 +24,6 @@ if (isset($_GET['error']) && $_GET['error'] == 'missing_required_field')
|
||||
<div class="wrap">
|
||||
<h1>Go Form Settings</h1>
|
||||
|
||||
<h2>Create New Form</h2>
|
||||
<form method="post" action=" <?= admin_url('admin-post.php') ?> ">
|
||||
<?= wp_nonce_field('go_form_create_form_action', 'go_form_create_form_nonce', true, false) ?>
|
||||
<input type="hidden" name="action" value="go_form_create_form">
|
||||
<table class="form-table">
|
||||
<tr>
|
||||
<th>
|
||||
<label for="form_name">Form Name:</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type="text" name="form_name" id="form_name" required>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p class="submit"><input type="submit" class="button button-primary" value="Create Form"></p>
|
||||
</form>
|
||||
|
||||
<h2>Manage Forms & Entries</h2>
|
||||
|
||||
<?php
|
||||
@@ -221,6 +204,16 @@ if (isset($_GET['error']) && $_GET['error'] == 'missing_required_field')
|
||||
|
||||
} else {
|
||||
|
||||
echo '<h2>Create New Form</h2>';
|
||||
echo '<form method="post" action="' . admin_url('admin-post.php') . '">';
|
||||
echo wp_nonce_field('go_form_create_form_action', 'go_form_create_form_nonce', true, false);
|
||||
echo '<input type="hidden" name="action" value="go_form_create_form">';
|
||||
echo '<table class="form-table">';
|
||||
echo '<tr><th><label for="form_name">Form Name:</label></th><td><input type="text" name="form_name" id="form_name" required></td></tr>';
|
||||
echo '</table>';
|
||||
echo '<p class="submit"><input type="submit" class="button button-primary" value="Create Form"></p>';
|
||||
echo '</form>';
|
||||
|
||||
$forms = go_form_get_forms();
|
||||
echo '<h3>Forms</h3><ul>';
|
||||
foreach ($forms as $f) {
|
||||
|
||||
Reference in New Issue
Block a user