The extension API is simply the set of hooks below. There is no separate registration function.
REST API
All routes are under /wp-json/wphd/v1/. The main ones:
| Route | Use |
|---|---|
| tickets, tickets/{id} | List, create, read and update tickets |
| tickets/{id}/replies, tickets/{id}/notes | Replies and internal notes |
| tickets/{id}/merge, tickets/{id}/watch | Merge and watch |
| tickets/{id}/presence | Who is viewing or typing |
| tickets/{id}/fields, tags, teams, views, time | Routes added by modules: custom fields, tags, teams, saved views, time entries |
| tickets/{id}/team | Move a ticket to a team |
| departments, priorities, statuses | Lists |
| agents, assignees, customers/search | People |
| canned-responses | Canned responses |
| kb/search | Knowledge base search |
| message-threads | Agent messaging |
| ai/* | AI Assistant (agents only) |
| tickets/{id}/credentials | Private credentials (module) |
Authentication
HelpDesk WP adds no login system of its own. Every route checks the permissions of the logged-in WordPress user. The plugin's own pages use cookie login with the X-WP-Nonce header (the wp_rest nonce). Because these are ordinary WordPress REST routes, WordPress Application Passwords also work (HTTP Basic, normally over HTTPS) with the same permissions as that user. The private-credentials write routes need the cookie nonce, so Application Passwords do not work for them.
Some routes are public: GET departments, GET priorities, GET kb/search and POST kb/articles/{id}/feedback. POST tickets is public when guest tickets are on. Time entries are only available to agents and are never part of the ticket data customers receive.
To bring in data from elsewhere, you can create tickets through the API. Each one runs the normal flow: auto-assignment, status Open, today's date and confirmation emails. You cannot set historical dates.
PHP actions
| Hook | Fires |
|---|---|
| wphd_ticket_created | When a ticket is created, with ($ticket_id, $data, $author_id). |
| wphd_new_ticket | After the new ticket is set up, with ($ticket_id). |
| wphd_ticket_updated | After an agent changes status, priority, department, assignment or tags. It does not fire for replies. Arguments: ($ticket_id, $changes, $user_id). |
| wphd_new_reply | After a reply, with ($ticket_id, $comment_id, $user_id). |
| wphd_new_note | After an internal note, with ($ticket_id, $comment_id, $user_id). |
| wphd_tickets_merged | After a merge, with ($primary_id, $secondary_id, $user_id). |
Also available: wphd_privacy_erase_ticket, wphd_privacy_erase_comment, wphd_admin_menu_items, wphd_enqueue_public_assets, and template actions such as wphd_ticket_form_top, wphd_ticket_form_before_submit, wphd_single_ticket_after_header, wphd_single_ticket_before_replies, wphd_reply_form_actions, wphd_agent_dashboard_before_search and wphd_my_tickets_before_search.
PHP filters
| Filter | Use |
|---|---|
| wphd_can_submit_ticket | Allow or block a submission |
| wphd_ticket_submission_allowed | The spam or CAPTCHA check, after the honeypot and rate limit |
| wphd_ticket_data_valid | Extra validation |
| wphd_rest_create_ticket_data | Change the data before a ticket is created |
| wphd_format_ticket | Change ticket data returned |
| wphd_list_tickets_args | Change ticket list queries |
| wphd_allowed_attachment_extensions | The attachment file type allow-list |
| wphd_max_attachment_size | The upload size limit, in bytes |
| wphd_grantable_capabilities | Add a permission tick box to the Agents screen |
| wphd_notification_recipients | Change who gets an email |
| wphd_submitter_ip | The IP address used for the rate limit |
| wphd_ticket_rate_limit, wphd_ticket_rate_limit_window | Change the rate limit |
| wphd_closed_status_slugs, wphd_dashboard_open_views | Which statuses count as closed, and the dashboard views |
| wphd_ticket_form_render, wphd_ticket_form_settings, wphd_ticket_form_show_field | Change the ticket form |
| wphd_kb_page_id, wphd_kb_base, wphd_kb_articles_per_page, wphd_kb_default_category_name, wphd_kb_seo_plugin_active | Knowledge base settings |
| wphd_business_hours_config | Business hours setup |
| wphd_is_licensed | The licence state |
Business hours also has PHP helper functions: wphd_business_hours_enabled(), wphd_is_open_now( $department_id ), wphd_business_add_seconds() and wphd_business_seconds_between().
JavaScript events
The events are jQuery events on document, not native DOM events:
- wphd_ticket_loaded fires when a ticket loads in the portal: $(document).on('wphd_ticket_loaded', function (e, ticket, $wrap) { … });
- Others include wphd_reload_ticket, wphd_reload_list, wphd_list_params and wphd_ticket_row.
Webhook payloads are described in "Sending ticket events with Webhooks".
Still stuck? Open a ticket on the support page on ABC and a real person will help.
Was this article helpful?
