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

WordPress Trac noreply at wordpress.org
Wed Oct 7 17:27:44 UTC 2020


#51470: [walker-nav-menu] Undefined property stdclass::$current in nav-menu-
template.php
--------------------------+-----------------------------
 Reporter:  rejuancse     |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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 ) . '"' : '';
 }}}

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


More information about the wp-trac mailing list