Skip to content

fix(admin): stop ticket list rendering twice on the wp-admin page#43

Merged
mpge merged 1 commit intomainfrom
fix/admin-tickets-double-render
Apr 27, 2026
Merged

fix(admin): stop ticket list rendering twice on the wp-admin page#43
mpge merged 1 commit intomainfrom
fix/admin-tickets-double-render

Conversation

@mpge
Copy link
Copy Markdown
Member

@mpge mpge commented Apr 27, 2026

add_menu_page auto-creates a submenu with the parent slug. The explicit add_submenu_page with the same slug re-registers render_list on the page-load hook, causing it to fire twice and the entire tickets table to render twice (see screenshots/results/ticket-list.png pre-fix).

`add_menu_page` auto-creates a submenu entry with the parent slug.
Adding an explicit `add_submenu_page` with the same slug re-registers
the `render_list` callback on the page-load hook, so the callback
fires twice and the entire tickets table renders twice (visible in
the bug-report screenshot at screenshots/results/ticket-list.png).

Drop the redundant submenu registration and pass 'Tickets' as the
menu_title — WordPress reuses that for the auto-created submenu so
the sidebar still reads 'Tickets' under 'Escalated'.
@mpge mpge merged commit d240555 into main Apr 27, 2026
3 checks passed
@mpge mpge deleted the fix/admin-tickets-double-render branch April 27, 2026 03:37
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