WordPress.org

Make WordPress Core

Changeset 42026


Ignore:
Timestamp:
10/25/17 22:28:43 (3 months ago)
Author:
obenland
Message:

Menus: Add menu-$i slugs to mapping groups

Helps to future proof the feature.
Also orders slugs by popularity to optimize mapping time.

See #39692.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/nav-menu.php

    r41982 r42026  
    11251125     */ 
    11261126    $common_slug_groups = array( 
    1127         array( 'header', 'main', 'navigation', 'primary', 'top' ), 
    1128         array( 'bottom', 'footer', 'secondary', 'subsidiary' ), 
     1127        array( 'primary', 'menu-1', 'main', 'header', 'navigation', 'top' ), 
     1128        array( 'secondary', 'menu-2', 'footer', 'subsidiary', 'bottom' ), 
    11291129        array( 'social' ), 
    11301130    ); 
  • trunk/tests/phpunit/tests/menu/nav-menu.php

    r41811 r42026  
    173173 
    174174        $expected_nav_menu_locations = array( 
    175             'main' => 1, 
    176             'primary' => 2, 
     175            'primary' => 1, 
     176            'main' => 2, 
    177177        ); 
    178178        $this->assertEquals( $expected_nav_menu_locations, $new_next_theme_nav_menu_locations ); 
Note: See TracChangeset for help on using the changeset viewer.