Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Trac 39692: Fix missing assignment of menus on theme switch #245

Closed
wants to merge 10 commits into
from

Conversation

Projects
None yet
3 participants

@westonruter westonruter changed the title from Trac 39692: Preview link clicked - save a revision to Trac 39692: Fix missing assignment of menus on theme switch Aug 4, 2017

src/wp-includes/nav-menu.php
+ array( 'header', 'main', 'navigation', 'primary', 'top' ),
+ array( 'bottom', 'footer', 'secondary', 'subsidiary' ),
+ array( 'social' ),
+ // TODO: Find a second slug or remove, since locations with same slug are already mapped.
@westonruter

westonruter Aug 7, 2017

Owner

@obenland what needs to be done here?

src/wp-includes/nav-menu.php
+ $new_nav_menu_locations[ $new_location ] = $old_nav_menu_locations[ $location ];
+
+ // Remove the mapped location so it can't be mapped again.
+ unset( $old_nav_menu_locations[ $location ] );
@westonruter

westonruter Aug 7, 2017

Owner

@obenland I recall there being some unexpected behaviors when modifying an array while iterating over it. Is this why you have the Make sure this location wasn't mapped and removed previously condition above?

Owner

westonruter commented Aug 9, 2017

Committed to trunk in r41237.

@westonruter westonruter closed this Aug 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment