WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/09/17 21:03:16 (2 weeks ago)
Author:
obenland
Message:

Map nav menu locations on theme switch

This will send nav menu locations through three levels of mapping:

  1. If both themes have only one location, that gets mapped.
  2. If both themes have locations with the same slug, they get mapped.
  3. Locations that (even partially) match slugs from a similar kind of menu location will get mapped.

Menu locations are mapped for Live Previews in the Customizer and during theme switches.

Props westonruter, obenland, welcher, melchoyce.
Fixes #39692.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/default-filters.php

    r41232 r41237  
    263263add_action( 'wp_print_footer_scripts', '_wp_footer_scripts'                 ); 
    264264add_action( 'init',                'check_theme_switched',            99    ); 
     265add_action( 'after_switch_theme',  '_wp_menus_changed'                      ); 
    265266add_action( 'after_switch_theme',  '_wp_sidebars_changed'                   ); 
    266267add_action( 'wp_print_styles',     'print_emoji_styles'                     ); 
Note: See TracChangeset for help on using the changeset viewer.