From 52ec03b9473209b642569e54769a408d6211b343 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Fri, 28 May 2010 20:41:39 +0000 Subject: [PATCH] Don't show (pending) in JS mode for nav menus UI. props filosofo, fixes #13604. git-svn-id: https://develop.svn.wordpress.org/trunk@15047 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/admin-ajax.php | 4 +++- wp-admin/includes/nav-menu.php | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 09cc4e3945..653eab7c58 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -823,7 +823,9 @@ case 'add-menu-item' : foreach ( (array) $item_ids as $menu_item_id ) { $menu_obj = get_post( $menu_item_id ); if ( ! empty( $menu_obj->ID ) ) { - $menu_items[] = wp_setup_nav_menu_item( $menu_obj ); + $menu_obj = wp_setup_nav_menu_item( $menu_obj ); + $menu_obj->label = $menu_obj->title; // don't show "(pending)" in ajax-added items + $menu_items[] = $menu_obj; } } diff --git a/wp-admin/includes/nav-menu.php b/wp-admin/includes/nav-menu.php index 19d5debd3f..7de368b52f 100644 --- a/wp-admin/includes/nav-menu.php +++ b/wp-admin/includes/nav-menu.php @@ -73,6 +73,8 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu { $title = sprintf( __('%s (Pending)'), $item->title ); } + $title = empty( $item->label ) ? $title : $item->label; + ?>