'parent', 'id' => 'id' ); /** * Outputs one element * * @since 1.2 * * @param string $output Passed by reference. Used to append additional content. * @param stdClass $element The data object. * @param int $depth Depth of the item. * @param array $args An array of additional arguments. * @param int $current_object_id ID of the current item. * @return void */ public function start_el( &$output, $element, $depth = 0, $args = array(), $current_object_id = 0 ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable // Link attributes. $link_atts = sprintf( 'lang="%1$s" hreflang="%1$s" href="%2$s"', esc_attr( $element->locale ), esc_url( $element->url ) ); if ( ! empty( $element->link_classes ) ) { $link_atts .= sprintf( ' class="%s"', esc_attr( implode( ' ', $element->link_classes ) ) ); } if ( ! empty( $element->current_lang ) ) { $link_atts .= ' aria-current="true"'; } // Text label. if ( $args['show_flags'] && $args['show_names'] ) { $label = sprintf( '%2$s', is_rtl() ? 'right' : 'left', esc_html( $element->name ) ); } else { $label = esc_html( $element->name ); } $output .= sprintf( '%5$s