[wp-trac] [WordPress Trac] #28138: Updating menu item requires passing all of a menu item's data to wp_update_nav_menu_item()

WordPress Trac noreply at wordpress.org
Mon May 5 18:59:54 UTC 2014


#28138: Updating menu item requires passing all of a menu item's data to
wp_update_nav_menu_item()
-----------------------------+------------------------------------------
 Reporter:  danielbachhuber  |      Owner:
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Future Release
Component:  Menus            |    Version:
 Severity:  normal           |   Keywords:  needs-patch needs-unit-tests
  Focuses:                   |
-----------------------------+------------------------------------------
 When using `wp_update_nav_menu_item()` to updating an existing menu item,
 you need to pass all data associated with a menu item in order to have the
 data persist.

 This is because the `$defaults` are set to default values, instead of the
 existing menu item values
 ([https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/nav-
 menu.php#L323 ref]).

 If the menu item exists, the defaults should be set to the existing menu
 item values.

 Discovered in https://github.com/wp-cli/wp-cli/pull/1182

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28138>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list