Make WordPress Core

Changeset 40300 for trunk


Ignore:
Timestamp:
03/18/2017 03:22:08 AM (8 years ago)
Author:
westonruter
Message:

Customize: Trailingslash the home nav menu item URL in starter content.

This prevents an additional 301 redirect when clicking on the nav menu item, and it also prevents a scenario where the auth cookie may not be passed and cause an authentication error when navigating in the customizer.

Props dlh, swissspidy.
Fixes #40112.

Location:
trunk
Files:
2 edited

Legend:

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

    r40086 r40300  
    19851985                'type' => 'custom',
    19861986                'title' => _x( 'Home', 'Theme starter content' ),
    1987                 'url' => home_url(),
     1987                'url' => home_url( '/' ),
    19881988            ),
    19891989            'page_home' => array( // Deprecated in favor of link_home.
  • trunk/tests/phpunit/tests/customize/manager.php

    r40142 r40300  
    491491        $this->assertEquals( 0, $changeset_values['nav_menu_item[-1]']['object_id'] );
    492492        $this->assertEquals( 'custom', $changeset_values['nav_menu_item[-1]']['type'] );
    493         $this->assertEquals( home_url(), $changeset_values['nav_menu_item[-1]']['url'] );
     493        $this->assertEquals( home_url( '/' ), $changeset_values['nav_menu_item[-1]']['url'] );
    494494
    495495        $this->assertEmpty( $wp_customize->changeset_data() );
Note: See TracChangeset for help on using the changeset viewer.