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. git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39575 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
78c5da52b5
commit
26caea9b90
@ -169,7 +169,7 @@ function twentyseventeen_setup() {
|
||||
'top' => array(
|
||||
'name' => __( 'Top Menu', 'twentyseventeen' ),
|
||||
'items' => array(
|
||||
'page_home',
|
||||
'link_home',
|
||||
'page_about',
|
||||
'page_blog',
|
||||
'page_contact',
|
||||
|
@ -1965,7 +1965,12 @@ function get_theme_starter_content() {
|
||||
) ),
|
||||
),
|
||||
'nav_menus' => array(
|
||||
'page_home' => array(
|
||||
'link_home' => array(
|
||||
'type' => 'custom',
|
||||
'title' => _x( 'Home', 'Theme starter content' ),
|
||||
'url' => home_url(),
|
||||
),
|
||||
'page_home' => array( // Deprecated in favor of home_link.
|
||||
'type' => 'post_type',
|
||||
'object' => 'page',
|
||||
'object_id' => '{{home}}',
|
||||
|
@ -350,7 +350,7 @@ class Tests_WP_Customize_Manager extends WP_UnitTestCase {
|
||||
'top' => array(
|
||||
'name' => 'Menu Name',
|
||||
'items' => array(
|
||||
'page_home',
|
||||
'link_home',
|
||||
'page_about',
|
||||
'page_blog',
|
||||
'link_email',
|
||||
@ -478,7 +478,9 @@ class Tests_WP_Customize_Manager extends WP_UnitTestCase {
|
||||
$this->assertEquals( $posts_by_name['blog'], $changeset_values['page_for_posts'] );
|
||||
|
||||
$this->assertEquals( -1, $changeset_values['nav_menu_locations[top]'] );
|
||||
$this->assertEquals( $posts_by_name['home'], $changeset_values['nav_menu_item[-1]']['object_id'] );
|
||||
$this->assertEquals( 0, $changeset_values['nav_menu_item[-1]']['object_id'] );
|
||||
$this->assertEquals( 'custom', $changeset_values['nav_menu_item[-1]']['type'] );
|
||||
$this->assertEquals( home_url(), $changeset_values['nav_menu_item[-1]']['url'] );
|
||||
|
||||
$this->assertEmpty( $wp_customize->changeset_data() );
|
||||
$this->assertNull( $wp_customize->changeset_post_id() );
|
||||
|
Loading…
Reference in New Issue
Block a user