Opened 7 weeks ago
Closed 11 days ago
#49374 closed enhancement (fixed)
Use get_post_states to denote special pages on the added menu item accordions
Reported by: | garrett-eclipse | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.4 | Priority: | normal |
Severity: | normal | Version: | 5.3 |
Component: | Menus | Keywords: | has-patch has-screenshots commit fixed-major dev-reviewed |
Focuses: | ui, administration | Cc: |
Description
This is a follow-up ticket to #37782 which introduced the use of get_post_states to denote special pages in the menu editor. When a special page is selected and added to the menu now the item is just denoted as Page but would be nice to follow suit and denote it as appropriate (Front Page, Posts Page, Privacy Policy Page).
Attachments (3)
Change History (17)
#1
@
7 weeks ago
- Keywords has-patch has-screenshots needs-testing added
I've uploaded a patch and screenshots to illustrate the change.
#4
@
7 weeks ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 47211:
#5
@
7 weeks ago
- Resolution fixed deleted
- Status changed from closed to reopened
Since get_post_states()
is only available in the admin, this is causing fatal errors on front end:
Fatal error: Uncaught Error: Call to undefined function get_post_states() in wp-includes/nav-menu.php:82
#7
@
7 weeks ago
Thanks @SergeyBiryukov appreciate the catch, I overlooked that was also available to the front-end.
This ticket was mentioned in Slack in #core by pbiron. View the logs.
2 weeks ago
#9
follow-up:
↓ 10
@
2 weeks ago
- Resolution fixed deleted
- Status changed from closed to reopened
In the original use case for the get_post_states() function to add statuses to the pages backend is not escaped, this allowed several plugins to add hints to the output:
Now in the edit menu screen it is escaped which causes issues:
I would be nice to keep the hints but if not an option then esc_html() should be replaced with wp_strip_all_tags()
#10
in reply to:
↑ 9
@
13 days ago
Replying to stiofansisland:
Now in the edit menu screen it is escaped which causes issues:
It would be nice to keep the hints but if not an option then esc_html() should be replaced with wp_strip_all_tags()
Thanks for catching that! Since we're in late RC stage for 5.4, going with the latter option for now seems safer.
Patch to denote special pages (Front Page, Posts Page and Privacy Policy Page) when inserted into the menu