Small fixes
This commit is contained in:
@@ -74,7 +74,7 @@ $ranks = [
|
||||
function go_form_get_forms()
|
||||
{
|
||||
global $wpdb;
|
||||
return $wpdb->get_results("SELECT * FROM {$wpdb->prefix}go_form_forms ORDER BY name ASC");
|
||||
return $wpdb->get_results("SELECT * FROM {$wpdb->prefix}go_form_forms ORDER BY created_at DESC");
|
||||
}
|
||||
|
||||
function go_form_get_entries($form_id)
|
||||
@@ -200,9 +200,6 @@ function go_form_settings_page()
|
||||
wp_die('No access.');
|
||||
|
||||
$forms = go_form_get_forms();
|
||||
$entries_by_form = [];
|
||||
foreach ($forms as $f)
|
||||
$entries_by_form[$f->id] = go_form_get_entries($f->id);
|
||||
|
||||
if (isset($_GET['deleted']))
|
||||
echo '<div class="notice notice-success"><p>Deleted!</p></div>';
|
||||
@@ -228,7 +225,6 @@ function go_form_settings_page()
|
||||
}
|
||||
|
||||
foreach ($forms as $f) {
|
||||
$entries = $entries_by_form[$f->id] ?? [];
|
||||
echo '<div style="margin-bottom:20px">
|
||||
<h3>' . esc_html($f->name) . ' <span style="color:#888">(ID: ' . esc_html($f->id) . ')</span></h3>
|
||||
<p><small>Shortcode: <code>[go_form id=' . esc_html($f->id) . ']</code></small></p>
|
||||
@@ -240,7 +236,7 @@ function go_form_settings_page()
|
||||
<input type="submit" value="Delete Form" class="button delete" onclick="return confirm(\'Delete this form and ALL entries?\')">
|
||||
</form>';
|
||||
|
||||
go_form_render_entries_table($entries, true);
|
||||
go_form_render_entries_table(go_form_get_entries($f->id), true);
|
||||
echo '</div>';
|
||||
}
|
||||
echo '</div>';
|
||||
|
||||
Reference in New Issue
Block a user