[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
Tue Jun 10 17:24:37 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                      |  Resolution:
 Keywords:  needs-unit-tests has-patch  |     Focuses:
----------------------------------------+-----------------------------
Changes (by celloexpressions):

 * keywords:  needs-patch needs-unit-tests => needs-unit-tests has-patch


Comment:

 I think [attachment:28138.diff] works for now, but it seems like there
 should be a better way to approach this. Updating an item could be a
 completely different process from creating one, with only the fields where
 data is passed being handled in an update. `wp_update_nav_menu_item()` is
 a pretty big mess; it could maybe use some refactoring.

 I'd like to be able to only pass changed data in with the Menu Customizer;
 otherwise I'll likely end up doing something like [attachment:28138.diff]
 before calling `wp_update_nav_menu_item()`.

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


More information about the wp-trac mailing list