Fixes #973
This commit is contained in:
parent
577eea7f47
commit
ab9c9a3c78
|
@ -183,7 +183,12 @@ if ( ! class_exists( 'Understrap_WP_Bootstrap_Navwalker' ) ) {
|
|||
}
|
||||
|
||||
$atts['target'] = ! empty( $item->target ) ? $item->target : '';
|
||||
$atts['rel'] = ! empty( $item->xfn ) ? $item->xfn : '';
|
||||
if ( '_blank' === $item->target && empty( $item->xfn ) ) { // Thanks to LukaszJaro, see https://github.com/understrap/understrap/issues/973
|
||||
$atts['rel'] = 'noopener noreferrer';
|
||||
} else {
|
||||
$atts['rel'] = $item->xfn;
|
||||
}
|
||||
|
||||
// If item has_children add atts to <a>.
|
||||
if ( isset( $args->has_children ) && $args->has_children && 0 === $depth && $args->depth !== 1 ) {
|
||||
$atts['href'] = '#';
|
||||
|
|
Reference in New Issue