diff --git a/wp-includes/nav-menu.php b/wp-includes/nav-menu.php index 9b6eeba9b3..68a9e09c3c 100644 --- a/wp-includes/nav-menu.php +++ b/wp-includes/nav-menu.php @@ -456,11 +456,15 @@ function wp_update_nav_menu_item( $menu_id = 0, $menu_item_db_id = 0, $menu_item $original_parent = 0 < $menu_item_db_id ? get_post_field( 'post_parent', $menu_item_db_id ) : 0; - if ( 'custom' != $args['menu-item-type'] ) { - /* if non-custom menu item, then: - * use original object's URL - * blank default title to sync with original object's - */ + if ( 'custom' === $args['menu-item-type'] ) { + // If custom menu item, trim the URL. + $args['menu-item-url'] = trim( $args['menu-item-url'] ); + } else { + /* + * If non-custom menu item, then: + * - use the original object's URL. + * - blank default title to sync with the original object's title. + */ $args['menu-item-url'] = ''; diff --git a/wp-includes/version.php b/wp-includes/version.php index 9db3644773..b9297ba395 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.2.3-alpha-45831'; +$wp_version = '5.2.3-alpha-45832'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.