Index: src/wp-admin/includes/class-walker-nav-menu-edit.php =================================================================== --- src/wp-admin/includes/class-walker-nav-menu-edit.php (revision 37430) +++ src/wp-admin/includes/class-walker-nav-menu-edit.php (working copy) @@ -15,6 +15,29 @@ * @uses Walker_Nav_Menu */ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu { + function __construct() { + $this->setup_hooks(); + } + + protected function setup_hooks() { + add_action( 'wp_edit_nav_menu_item_title', array( $this, 'get_menu_item_title_markup' ), 10, 3 ); + add_action( 'wp_edit_nav_menu_item_title', array( $this, 'get_menu_item_submenu_status_markup' ), 10, 3 ); + + add_action( 'wp_edit_nav_menu_item_controls', array( $this, 'get_menu_item_type_markup' ), 10, 3 ); + add_action( 'wp_edit_nav_menu_item_controls', array( $this, 'get_menu_item_order_no_js_markup' ), 10, 3 ); + add_action( 'wp_edit_nav_menu_item_controls', array( $this, 'get_menu_item_edit_link_markup' ), 10, 3 ); + + add_action( 'wp_edit_nav_menu_item_fields', array( $this, 'get_menu_item_fields_url_markup' ), 10, 2 ); + add_action( 'wp_edit_nav_menu_item_fields', array( $this, 'get_menu_item_fields_label_markup' ), 10, 2 ); + add_action( 'wp_edit_nav_menu_item_fields', array( $this, 'get_menu_item_fields_title_attr_markup' ), 10, 2 ); + add_action( 'wp_edit_nav_menu_item_fields', array( $this, 'get_menu_item_fields_target_markup' ), 10, 2 ); + add_action( 'wp_edit_nav_menu_item_fields', array( $this, 'get_menu_item_fields_class_markup' ), 10, 2 ); + add_action( 'wp_edit_nav_menu_item_fields', array( $this, 'get_menu_item_fields_description_markup' ), 10, 2 ); + add_action( 'wp_edit_nav_menu_item_fields', array( $this, 'get_menu_item_fields_move_for_js_markup' ), 10, 2 ); + add_action( 'wp_edit_nav_menu_item_fields', array( $this, 'get_menu_item_fields_actions_markup' ), 10, 2 ); + add_action( 'wp_edit_nav_menu_item_fields', array( $this, 'get_menu_item_fields_hidden_fields_markup' ), 10, 2 ); + } + /** * Starts the list before the elements are added. * @@ -61,15 +84,87 @@ ob_start(); $item_id = esc_attr( $item->ID ); - $removed_args = array( - 'action', - 'customlink-tab', - 'edit-menu-item', - 'menu-item', - 'page-tab', - '_wpnonce', + + $original_title = $this->get_original_title( $item ); + + $classes = $this->get_nav_item_classes( $item, $item_id, $depth ); + ?> +
+ +
+ ++ +
+ -+ +
+ "> - type ) : ?> -- -
- -- -
-- -
-- -
-- -
-- -
-- -
+ public function get_menu_item_fields_target_markup( $item, $item_id ) { + ?> ++ +
+ - - + public function get_menu_item_fields_class_markup( $item, $item_id ) { + ?> ++ +
+ - type && $original_title !== false ) : ?> -- url ) . '">' . esc_html( $original_title ) . '' ); ?> -
- - - + public function get_menu_item_fields_description_markup( $item, $item_id ) { + ?> ++ +
+ ]" value="" /> - - - - - - - + public function get_menu_item_fields_move_for_js_markup( $item, $item_id ) { + ?> + get_original_title( $item ); + + $cancel_url = esc_url( add_query_arg( array( 'edit-menu-item' => $item_id, 'cancel' => time() ), admin_url( 'nav-menus.php' ) ) ); + $cancel_url .= '#menu-item-settings-' . $item_id; + + $remove_url = $this->get_nonced_url($item_id, 'delete-menu-item', 'delete-menu_item_' . $item_id); + ?> + + + + + + + + +