[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 Oct 2 06:51:34 UTC 2020


#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        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------

Comment (by rejuancse):

 Hello @winston_wolf,
 In the WordPress update version, we are facing the exact same issue,

 In wp-includes/nav-menu-template.php line 190 there’s a missing empty();
 function around $args->container_aria_label.
 Causes PHP errors everywhere wp_nav_menu(); function occurrence:


 {{{
 $aria_label = ( 'nav' === $args->container && $args->container_aria_label
 ) ? ' aria-label="' . esc_attr( $args->container_aria_label ) . '"' : '';
 }}}

 Should be:

 {{{
 $aria_label = ( 'nav' === $args->container &&
 !empty($args->container_aria_label) ) ? ' aria-label="' . esc_attr(
 $args->container_aria_label ) . '"' : '';
 }}}


 Thanks

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


More information about the wp-trac mailing list