[wp-trac] [WordPress Trac] #47533: wp_nav_menu() walker parameter breaks selective refresh

WordPress Trac noreply at wordpress.org
Thu Jun 13 10:15:08 UTC 2019


#47533: wp_nav_menu() walker parameter breaks selective refresh
--------------------------+----------------------
 Reporter:  sineway       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Customize     |     Version:  4.5
 Severity:  normal        |  Resolution:  invalid
 Keywords:                |     Focuses:
--------------------------+----------------------

Comment (by sineway):

 Thanks for your reply, guys!

 I found out that there are conditions for why a menu change will get a
 full page refresh from [https://make.wordpress.org/core/2015/07/29/fast-
 previewing-changes-to-menus-in-the-customizer/ this post] by @westonruter

 Then I made these steps:

 ''(1)'' Instead of object, I passed just a walker's class name to
 wp_nav_menu() and initialize it later via filter `wp_nav_menu_args`.

 The 'Click to edit' button appeared (it opens 'Locations' when I click
 it), but menu changes still trigger full page refresh.

 ''(2)'' Then I added another filter - `customize_dynamic_partial_args`,
 where I override render_callback to display my partial, containing
 wp_nav_menu() call.

 Now everything works, but I have concerns regarding step ''(2)'' cause I'm
 not sure whether it's right.

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


More information about the wp-trac mailing list