[wp-trac] [WordPress Trac] #23276: WordPress Importer: Update existing navs instead of new

WordPress Trac noreply at wordpress.org
Fri Apr 10 06:18:25 UTC 2026


#23276: WordPress Importer: Update existing navs instead of new
--------------------------+----------------------------
 Reporter:  WraithKenny   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  WordPress.org
Component:  Import        |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+----------------------------
Changes (by abcd95):

 * keywords:  needs-refresh needs-testing => has-patch


Comment:

 I think this patch will suffice and is the simplest fix I can think of,
 just checks whether a nav_menu_item post with the original ID already
 exists before calling wp_update_nav_menu_item(). If found, the existing ID
 is passed so the item is updated in place. If not found, 0 is passed,
 creating a new item.

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


More information about the wp-trac mailing list