Customizer: Ensure that a newly-added nav menu item gets the Original link populated in its control.

Props valendesigns.
Fixes #32858.


Built from https://develop.svn.wordpress.org/trunk@33089


git-svn-id: http://core.svn.wordpress.org/trunk@33060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2015-07-06 05:53:26 +00:00
parent b2e725eb27
commit a3c1814cc2
2 changed files with 9 additions and 5 deletions

View File

@ -120,7 +120,8 @@ final class WP_Customize_Nav_Menus {
'type' => 'post_type',
'type_label' => get_post_type_object( $post->post_type )->labels->singular_name,
'object' => $post->post_type,
'object_id' => (int) $post->ID,
'object_id' => intval( $post->ID ),
'url' => get_permalink( intval( $post->ID ) ),
);
}
} elseif ( 'taxonomy' === $obj_type ) {
@ -147,7 +148,8 @@ final class WP_Customize_Nav_Menus {
'type' => 'taxonomy',
'type_label' => get_taxonomy( $term->taxonomy )->labels->singular_name,
'object' => $term->taxonomy,
'object_id' => $term->term_id,
'object_id' => intval( $term->term_id ),
'url' => get_term_link( intval( $term->term_id ), $term->taxonomy ),
);
}
}
@ -228,11 +230,12 @@ final class WP_Customize_Nav_Menus {
}
$results[] = array(
'id' => 'post-' . $post->ID,
'title' => html_entity_decode( $post_title, ENT_QUOTES, get_bloginfo( 'charset' ) ),
'type' => 'post_type',
'type_label' => $post_type_objects[ $post->post_type ]->labels->singular_name,
'object' => $post->post_type,
'object_id' => intval( $post->ID ),
'title' => html_entity_decode( $post_title, ENT_QUOTES, get_bloginfo( 'charset' ) ),
'url' => get_permalink( intval( $post->ID ) ),
);
}
}
@ -250,11 +253,12 @@ final class WP_Customize_Nav_Menus {
foreach ( $terms as $term ) {
$results[] = array(
'id' => 'term-' . $term->term_id,
'title' => html_entity_decode( $term->name, ENT_QUOTES, get_bloginfo( 'charset' ) ),
'type' => 'taxonomy',
'type_label' => get_taxonomy( $term->taxonomy )->labels->singular_name,
'object' => $term->taxonomy,
'object_id' => intval( $term->term_id ),
'title' => html_entity_decode( $term->name, ENT_QUOTES, get_bloginfo( 'charset' ) ),
'url' => get_term_link( intval( $term->term_id ), $term->taxonomy ),
);
}
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.3-beta1-33088';
$wp_version = '4.3-beta1-33089';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.