[wp-trac] [WordPress Trac] #32781: Customizer Menus: Debug Notices

WordPress Trac noreply at wordpress.org
Wed Jun 24 14:54:20 UTC 2015


#32781: Customizer Menus: Debug Notices
-----------------------------+--------------------
 Reporter:  johnjamesjacoby  |       Owner:
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  4.3
Component:  Menus            |     Version:  trunk
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:
-----------------------------+--------------------

Comment (by johnjamesjacoby):

 The cause appears to be:

 {{{
 WP_Customize_Nav_Menus::filter_wp_nav_menu_args();
 }}}
 It's unsetting both the `fallback_cb` and `walker` arguments via a filter
 to `wp_nav_menu_args`.

 Currently in `wp_nav_menu()`, all object variables are assumed to be at
 least set. I see two potential fixes:

 * Change the `unset()`'s in
 `WP_Customize_Nav_Menus::filter_wp_nav_menu_args();` to empty strings so
 they remain set
 * Wrap all object variable checks in `wp_nav_menu()` in `isset()` or `!
 empty()` to avoid notices

 I think for sure the second of the above two fixes should happen anyways,
 since (as usual) we cannot trust any object to ever have any variables set
 in any scope thanks to filters and nothing being immutable. I think the
 first of these two fixes should sufficiently address the original
 intentions.

 Tangent: we're starting to use `1000` as if it were some kind of
 `WP_MAX_FILTER_PRIORTY` (though 9999 is used in some other places.) Should
 we actually define these priorities somewhere?

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


More information about the wp-trac mailing list