-
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.
Migrate classic menus to block-based menus on theme switch (#36255)
* Migrate classic menus to block-based menus on theme switch * Add more comments * Short circuit if switching to a theme that does not support FSE * Preserve the menu name on migration * Replace WP_Query with wpdb->get_results * Adjust gutenberg_parse_blocks_from_menu_items to make use of innerContent * Lint * Replace return with continue * Code style: Assign $mapping after $locations * Update lib/navigation.php * Update lib/navigation.php * Rename $mapping to $area_mapping * Rename $pretend_old_theme to $get_old_theme_stylesheet * Explain why custom SQL is used instead of WP_Query * Use post_name instead of MD5 matching * Update the comment, remove global $wpdb * Only convert classic menus to blocks when the matching post wasn't found * Don't remove PHP functions from the navigation block, instead introduce new ones * Add a comment to explain how some functions are pasted * Use "Classic menu" as prefix for the migrated post
- Loading branch information
Showing
1 changed file
with
194 additions
and
0 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