Opened 4 years ago
Last modified 16 months ago
#46382 new defect (bug)
[walker-nav-menu] Undefined property stdclass::$current in class-walker-nav-menu.php
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 5.1 |
Component: | Menus | Keywords: | has-patch |
Focuses: | Cc: |
Description
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' : '';
Attachments (1)
Change History (5)
#3
@
3 years ago
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
Note: See
TracTickets for help on using
tickets.
Hi @winston_wolf, Welcome to WordPres Trac! Thanks for the report.
Good cache.