[wp-trac] [WordPress Trac] #31257: Variable initialized with value of inappropriate type

WordPress Trac noreply at wordpress.org
Sat Feb 7 15:53:55 UTC 2015


#31257: Variable initialized with value of inappropriate type
-------------------------+-----------------------------
 Reporter:  ipm-frommen  |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Menus        |    Version:
 Severity:  normal       |   Keywords:
  Focuses:  template     |
-------------------------+-----------------------------
 Everywhere in the `_wp_menu_output` function, the `$submenu_items`
 variable is treated like an `array`; so why not initialize it with
 `array()`, instead of `false`?

 There are several `! empty( $submenu_items )` checks, and these work
 perfectly fine with `$submenu_items` being an empty array.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31257>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list