Menus: Trim whitespace from custom link URLs.

Props majemedia, SergeyBiryukov.
Merges [45655] and [45656] to the 5.2 branch.
Fixes #47723.
Built from https://develop.svn.wordpress.org/branches/5.2@45832


git-svn-id: http://core.svn.wordpress.org/branches/5.2@45643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-08-19 04:07:52 +00:00
parent d8a0523887
commit 7ab695d1d6
2 changed files with 10 additions and 6 deletions

View File

@ -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; $original_parent = 0 < $menu_item_db_id ? get_post_field( 'post_parent', $menu_item_db_id ) : 0;
if ( 'custom' != $args['menu-item-type'] ) { if ( 'custom' === $args['menu-item-type'] ) {
/* if non-custom menu item, then: // If custom menu item, trim the URL.
* use original object's URL $args['menu-item-url'] = trim( $args['menu-item-url'] );
* blank default title to sync with original object's } 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'] = ''; $args['menu-item-url'] = '';

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @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. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.