WordPress.org

Make WordPress Core

Changeset 40338


Ignore:
Timestamp:
03/27/2017 09:28:36 AM (14 months ago)
Author:
swissspidy
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.

Merges [40300] to the 4.7 branch.

Location:
branches/4.7
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/src/wp-includes/theme.php

    r40087 r40338  
    19841984                'type' => 'custom',
    19851985                'title' => _x( 'Home', 'Theme starter content' ),
    1986                 'url' => home_url(),
     1986                'url' => home_url( '/' ),
    19871987            ),
    19881988            'page_home' => array( // Deprecated in favor of home_link.
  • branches/4.7/tests/phpunit/tests/customize/manager.php

    r40099 r40338  
    485485        $this->assertEquals( 0, $changeset_values['nav_menu_item[-1]']['object_id'] );
    486486        $this->assertEquals( 'custom', $changeset_values['nav_menu_item[-1]']['type'] );
    487         $this->assertEquals( home_url(), $changeset_values['nav_menu_item[-1]']['url'] );
     487        $this->assertEquals( home_url( '/' ), $changeset_values['nav_menu_item[-1]']['url'] );
    488488
    489489        $this->assertEmpty( $wp_customize->changeset_data() );
Note: See TracChangeset for help on using the changeset viewer.