fix(admin): stop ticket list rendering twice on the wp-admin page#43
Merged
fix(admin): stop ticket list rendering twice on the wp-admin page#43
Conversation
`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'.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add_menu_pageauto-creates a submenu with the parent slug. The explicitadd_submenu_pagewith the same slug re-registersrender_liston 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).