WordPress.org

Make WordPress Core

Changeset 39575


Ignore:
Timestamp:
12/12/16 02:24:19 (6 months ago)
Author:
dd32
Message:

Customize: Deprecate page_home nav menu item starter content in favor of home_link; replace usage in Twenty Seventeen.

Props celloexpressions, westonruter.
See #38615, #38114, [38991].
Merges [39561] to the 4.7 branch.
Fixes #39104.

Location:
branches/4.7
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/src/wp-content/themes/twentyseventeen/functions.php

    r39374 r39575  
    170170                'name' => __( 'Top Menu', 'twentyseventeen' ), 
    171171                'items' => array( 
    172                     'page_home', 
     172                    'link_home', 
    173173                    'page_about', 
    174174                    'page_blog', 
  • branches/4.7/src/wp-includes/theme.php

    r39568 r39575  
    19661966        ), 
    19671967        'nav_menus' => array( 
    1968             'page_home' => array( 
     1968            'link_home' => array( 
     1969                'type' => 'custom', 
     1970                'title' => _x( 'Home', 'Theme starter content' ), 
     1971                'url' => home_url(), 
     1972            ), 
     1973            'page_home' => array( // Deprecated in favor of home_link. 
    19691974                'type' => 'post_type', 
    19701975                'object' => 'page', 
  • branches/4.7/tests/phpunit/tests/customize/manager.php

    r39573 r39575  
    351351                    'name'  => 'Menu Name', 
    352352                    'items' => array( 
    353                         'page_home', 
     353                        'link_home', 
    354354                        'page_about', 
    355355                        'page_blog', 
     
    479479 
    480480        $this->assertEquals( -1, $changeset_values['nav_menu_locations[top]'] ); 
    481         $this->assertEquals( $posts_by_name['home'], $changeset_values['nav_menu_item[-1]']['object_id'] ); 
     481        $this->assertEquals( 0, $changeset_values['nav_menu_item[-1]']['object_id'] ); 
     482        $this->assertEquals( 'custom', $changeset_values['nav_menu_item[-1]']['type'] ); 
     483        $this->assertEquals( home_url(), $changeset_values['nav_menu_item[-1]']['url'] ); 
    482484 
    483485        $this->assertEmpty( $wp_customize->changeset_data() ); 
Note: See TracChangeset for help on using the changeset viewer.