Add complete custom fields implementation and entry editing

- Add custom field CRUD in admin UI (create, read, update, delete)
- Display custom fields on frontend form with proper field types
- Save custom field values on form submission
- Display custom field columns in entries table (admin and public)
- Include custom field values in all export formats (CSV, PairGoTh, OpenGotha, McMahon)
- Add Edit button and form for entries
- Update entry handler to support editing with custom field values
- Add success/error notices for all admin actions

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
2026-05-12 13:02:33 +02:00
parent bd7b9e1731
commit 2d537f07dd
5 changed files with 510 additions and 12 deletions

View File

@@ -8,6 +8,14 @@
<th>Rank</th>
<th>EGD Number</th>
<th>Date Added</th>
<?php
// Add custom field columns
foreach ($custom_fields as $field):
if ($field->is_public || $show_admin):
echo '<th>' . esc_html($field->field_name) . '</th>';
endif;
endforeach;
?>
<?php if ($show_admin): ?>
<th>Rating</th>
<th>Action</th>
@@ -26,11 +34,27 @@
<td> <?= esc_html($ranks[$e->rank]) ?> </td>
<td> <?= esc_html($e->egd_number) ?> </td>
<td> <?= esc_html($e->created_at) ?> </td>
<?php
// Display custom field values
foreach ($custom_fields as $field):
if ($field->is_public || $show_admin):
echo '<td>';
$value = go_form_get_custom_value($e->id, $field->id);
if ($field->field_type === 'checkbox') {
echo $value ? 'Yes' : 'No';
} else {
echo esc_html($value);
}
echo '</td>';
endif;
endforeach;
?>
<?php if ($show_admin): ?>
<td> <?= esc_html($e->rating) ?> </td>
<td>
<a href="<?= add_query_arg(array('page' => 'go-form-settings', 'form_id' => $form_id ?? 0, 'edit_entry' => $e->id), admin_url('admin.php')) ?>" class="button button-small">Edit</a>
<?php action_button('go_form_delete_entry', 'Delete', 'Delete this entry?', $e->id); ?>
</td>