From a3c1814cc2465163ced2d6090979c8a44ab02312 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Mon, 6 Jul 2015 05:53:26 +0000 Subject: [PATCH] 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 --- wp-includes/class-wp-customize-nav-menus.php | 12 ++++++++---- wp-includes/version.php | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/wp-includes/class-wp-customize-nav-menus.php b/wp-includes/class-wp-customize-nav-menus.php index 3d9e60f565..7d32cbb743 100644 --- a/wp-includes/class-wp-customize-nav-menus.php +++ b/wp-includes/class-wp-customize-nav-menus.php @@ -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 ), ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 3375e2238d..458fbc734c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.