[wp-trac] [WordPress Trac] #47524: Predefined value of param is wrong in \Walker_Nav_Menu::start_lvl

WordPress Trac noreply at wordpress.org
Tue Jun 11 08:39:11 UTC 2019


#47524: Predefined value of param is wrong in \Walker_Nav_Menu::start_lvl
--------------------------+-----------------------------
 Reporter:  trasweb       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Menus         |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Signature of `start_lvl` in Walker_Nav_Menu class is:

 {{{#!php
 <?php
 public function start_lvl( &$output, $depth = 0, $args = array() )
 }}}


 In this, `$args` is array.

 However, `$args` is `stdClass` as we can see in comment of that method:

 {{{#!php
 <?php
 /*
 ...
 * @param string   $output Used to append additional content (passed by
 reference).
 * @param int      $depth  Depth of menu item. Used for padding.
 * @param stdClass $args   An object of wp_nav_menu() arguments.
 ...
 */

 }}}

 Maybe null should be a better predefined value.

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


More information about the wp-trac mailing list