[wp-trac] [WordPress Trac] #35362: Empty `items_wrap` `wp_nav_menu` randomly breaks customizer

WordPress Trac noreply at wordpress.org
Tue Jan 12 00:05:55 UTC 2016


#35362: Empty `items_wrap` `wp_nav_menu` randomly breaks customizer
-------------------------------+------------------------------
 Reporter:  ojrask             |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Customize          |     Version:  4.4
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by westonruter):

 * keywords:   => reporter-feedback


Comment:

 @ojrask: Thanks for the report.

 I don't see how setting `items_wrap` to an empty string would work at all
 in the first place. When I try, the menu stops appearing altogether.

 The default value for `items_wrap` I see is `<ul id="%1$s"
 class="%2$s">%3$s</ul>`. This then is used in `wp_nav_menu()` via:

 {{{#!php
 <?php
 $nav_menu .= sprintf( $args->items_wrap, esc_attr( $wrap_id ), esc_attr(
 $wrap_class ), $items );
 }}}

 So if the `items_wrap` is empty, then no menu will be constructed at all
 from the format string.

 I am able to remote the wrapper element by setting `items_wrap` to
 `'%3$s'`.

 Are you removing the `container` in addition to the `items_wrap`? You
 could then actually be noticing what has been described here:
 https://make.wordpress.org/core/2015/07/29/fast-previewing-changes-to-
 menus-in-the-customizer/#comment-26503

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


More information about the wp-trac mailing list