Opened 6 weeks ago
Closed 21 hours ago
#49374 closed enhancement (fixed)
Use get_post_states to denote special pages on the added menu item accordions
Reported by: |
|
Owned by: |
|
---|---|---|---|
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).
Commits (4)
- [47211] Menus: Use
get_post_states()
to denote special pages on the added menu item accordions.… by @SergeyBiryukov 6 weeks ago - [47213] Menus: When adding a label for special pages in
wp_setup_nav_menu_item()
, check ifget_post_states()
is available, to avoid fatal errors on front end.… by @SergeyBiryukov 6 weeks ago - [47458] Menus: When adding a label for special pages in
wp_setup_nav_menu_item()
strip all HTML tags, as the label is escaped on output.… by @SergeyBiryukov 3 days ago - [47465] Menus: When adding a label for special pages in
wp_setup_nav_menu_item()
strip all HTML tags, as the label is escaped on output.… by @SergeyBiryukov 21 hours ago
Pull Requests
- Loading…
Change History (17)
#1
@
6 weeks ago
- Keywords has-patch has-screenshots needs-testing added
I've uploaded a patch and screenshots to illustrate the change.
#4
@ Core Committer
6 weeks ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 47211:
#5
@ Core Committer
6 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
#6
@ Core Committer
6 weeks ago
- Resolution set to fixed
- Status changed from reopened to closed
In 47213:
#7
@
5 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.
5 days ago
#9
follow-up:
↓ 10
@
5 days 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
@ Core Committer
3 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.
#11
@ Core Committer
3 days ago
- Resolution set to fixed
- Status changed from reopened to closed
In 47458:
Patch to denote special pages (Front Page, Posts Page and Privacy Policy Page) when inserted into the menu