-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Navigation: Fix creating Navigation from pages or menu with HTML in t…
…itle (#24673) * Navigation: Fix creating Navigation from pages or menu with HTML in title Pages and menu items in WordPress allow HTML in the title. We should therefore not escape the menu item title when creating a Navigation block from top-level pages or an existing menu. Additionally, the menu items REST API endpoint was setting title.raw to the menu item CPT's post_title and title.rendered to the referenced post's post_title. Both title.raw and title.rendered should be set to the menu item's title, which is properly set by wp_setup_nav_menu_item(). The only difference is that title.rendered should be passed through the_title, which escapes & characters, and nav_menu_item_title, which provides plugins a chance to customise menu item titles before display. This matches what Walker_Nav_Menu does. * REST API: Test that menu items have their title properly escaped * REST API: Fix menu items unit tests for multisite environments * REST API: Use is_multisite() instead of MULTISITE Co-authored-by: Timothy Jacobs <[email protected]> Co-authored-by: Timothy Jacobs <[email protected]>
- Loading branch information
1 parent
b418bf7
commit dda3a9c
Showing
3 changed files
with
71 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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