[wp-trac] [WordPress Trac] #46382: [walker-nav-menu] Undefined property stdclass::$current in class-walker-nav-menu.php

WordPress Trac noreply at wordpress.org
Fri Mar 1 08:24:53 UTC 2019


#46382: [walker-nav-menu] Undefined property stdclass::$current in class-walker-
nav-menu.php
--------------------------+-----------------------------
 Reporter:  winston_wolf  |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Menus         |    Version:  5.1
 Severity:  normal        |   Keywords:  has-patch
  Focuses:                |
--------------------------+-----------------------------
 In **wp-includes/class-walker-nav-menu.php line 177** there's a missing
 ''empty();'' function around ''$item->current''.
 Causes PHP errors everywhere ''wp_nav_menu();'' function occurrence:

 {{{
 $atts['aria-current'] = $item->current ? 'page' : '';
 }}}

 Should be:

 {{{
 $atts['aria-current'] = ! empty( $item->current ) ? 'page' : '';
 }}}

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


More information about the wp-trac mailing list