From 89919f6ac457a8ba95741ac0ebf902d7d7468846 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 9 Jul 2019 20:44:03 +0000 Subject: [PATCH] Menus: Remove extra whitespace from URLs in `Walker_Nav_Menu_Edit::start_el()`. Props alexeyskr, SergeyBiryukov. Fixes #47666. git-svn-id: https://develop.svn.wordpress.org/trunk@45614 602fd350-edb4-49c9-b593-d223f7449a82 --- .../includes/class-walker-nav-menu-edit.php | 99 ++++++++++++------- 1 file changed, 64 insertions(+), 35 deletions(-) diff --git a/src/wp-admin/includes/class-walker-nav-menu-edit.php b/src/wp-admin/includes/class-walker-nav-menu-edit.php index eb940af37c..974b00bee5 100644 --- a/src/wp-admin/includes/class-walker-nav-menu-edit.php +++ b/src/wp-admin/includes/class-walker-nav-menu-edit.php @@ -119,9 +119,10 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu { type_label ); ?> - ', + wp_nonce_url( add_query_arg( array( 'action' => 'move-up-menu-item', @@ -130,13 +131,15 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu { remove_query_arg( $removed_args, admin_url( 'nav-menus.php' ) ) ), 'move-menu_item' - ); + ), + esc_attr__( 'Move up' ) + ); ?> - " class="item-move-up" aria-label="">↑ | - ', + wp_nonce_url( add_query_arg( array( 'action' => 'move-down-menu-item', @@ -145,15 +148,31 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu { remove_query_arg( $removed_args, admin_url( 'nav-menus.php' ) ) ), 'move-menu_item' - ); + ), + esc_attr__( 'Move down' ) + ); ?> - " class="item-move-down" aria-label="">↓ - + $item_id, + ), + remove_query_arg( $removed_args, admin_url( 'nav-menus.php#menu-item-settings-' . $item_id ) ) + ); + } + + printf( + '%s', + $item_id, + $edit_url, + esc_attr__( 'Edit menu item' ), + __( 'Edit' ) + ); + ?> @@ -223,32 +242,42 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu { ?>

- | %s', + $item_id, + wp_nonce_url( + add_query_arg( + array( + 'action' => 'delete-menu-item', + 'menu-item' => $item_id, + ), + admin_url( 'nav-menus.php' ) ), - admin_url( 'nav-menus.php' ) - ) + 'delete-menu_item_' . $item_id + ), + __( 'Remove' ) + ); + ?> + | + %s', + $item_id, + esc_url( + add_query_arg( + array( + 'edit-menu-item' => $item_id, + 'cancel' => time(), + ), + admin_url( 'nav-menus.php' ) + ) + ), + $item_id, + __( 'Cancel' ) ); ?> - #menu-item-settings-">