[wp-meta] [Making WordPress.org] #1109: Site Cloner: Add support for importing menus

Making WordPress.org noreply at wordpress.org
Sat May 12 13:47:44 UTC 2018


#1109: Site Cloner: Add support for importing menus
--------------------------------------------------+-----------------------
 Reporter:  iandunn                               |       Owner:  (none)
     Type:  enhancement                           |      Status:  assigned
 Priority:  normal                                |   Milestone:
Component:  WordCamp Site & Plugins               |  Resolution:
 Keywords:  good-first-bug has-patch 2nd-opinion  |
--------------------------------------------------+-----------------------

Comment (by chandrapatel):

 Hello @iandunn @coreymckrill

 Sorry for late working on this.

 I've updated patch
 [https://meta.trac.wordpress.org/attachment/ticket/1109/1109.2.diff
 1109.2.diff] to copy the menu items for pages that do exist on the
 destination site. I haven't consider menu items order and hierarchy when
 we copied menu items.

 `add_action( 'customize_register',    __NAMESPACE__ .
 '\register_customizer_components', 12 );`

 I've changed the priority to `12` becasue `nav_menu_locations` theme mod
 which I set after copied over menus from source site are overriden by
 customizer `nav_menu_locations` setting. Customizer also update
 `nav_menu_locations` theme mod when we change theme.

 So I debug the issue and found that our import menu code executed first
 and then customizer's `nav_menu_locations` setting updated. I found that
 customizer register function on `customize_register` action at `11`
 priority to register `nav_menu_locations` setting. So I've updated our
 hook at `12` priority to execute our code at last and prevent overriden of
 `nav_menu_locations` theme mod.

 Please check the updated patch and let me know if it's fine or if I miss
 any use cases.

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/1109#comment:18>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list