Skip to content

feat(admin): public-ticket guest policy fields in settings page#34

Open
mpge wants to merge 1 commit intomainfrom
feat/admin-public-tickets-settings
Open

feat(admin): public-ticket guest policy fields in settings page#34
mpge wants to merge 1 commit intomainfrom
feat/admin-public-tickets-settings

Conversation

@mpge
Copy link
Copy Markdown
Member

@mpge mpge commented Apr 24, 2026

Summary

WordPress host-adapter side of the new public-ticket guest policy feature (escalated#32). WordPress doesn't use Inertia/Vue, so instead of a dedicated sub-page this extends the existing Escalated settings admin page with three new fields.

What's added

  • `class-admin-settings.php` — `guest_policy_mode` (dropdown, sanitized string), `guest_policy_user_id` (absint), `guest_policy_signup_url_template` (esc_url_raw) added to the whitelisted settings fields.
  • `templates/admin/settings.php` — new `` below the Guest Tickets checkbox with: mode dropdown, conditional shared-user-id number input, and signup URL template text input.
  • Defensive post-processing rejects unknown modes (falls back to `unassigned`) and clears the two conditional fields when the mode doesn't apply, so the widget controller only ever sees settings that actually match the currently-selected mode.

Why inline instead of a new subpage

The shared `Admin/Settings/PublicTickets.vue` is Inertia-only — WordPress renders PHP templates. The existing `class-admin-settings.php` / `templates/admin/settings.php` pair already covers every other Escalated setting in one page, so adding three fields here is the minimal-surface way to deliver the feature.

Test plan

  • Visit Escalated → Settings after merge, pick each of the three modes, verify the conditional fields only persist when their mode is active.
  • Confirm `Escalated\Models\Setting::get('guest_policy_mode')` returns the stored value.

Adds guest_policy_mode / guest_policy_user_id /
guest_policy_signup_url_template to the existing Escalated settings
admin page. WordPress doesn't use Inertia/Vue like the other host
adapters — this ports the same capability using the plugin's native
templates/admin/settings.php pattern.

The sanitization pass rejects unknown mode values and clears stale
fields when switching modes so the widget controller only sees
settings that actually apply to the currently-selected mode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant