| @@ -36,11 +36,14 @@ | ||
| 36 | 36 | * @return void |
| 37 | 37 | */ |
| 38 | 38 | public function widget( $args, $instance ) { |
| 39 | 39 | // Sets a unique id for dropdown. |
| 40 | - $instance['dropdown'] = empty( $instance['dropdown'] ) ? 0 : $args['widget_id']; | |
| 40 | + $instance['dropdown'] = empty( $instance['dropdown'] ) ? 0 : $this->id; | |
| 41 | + $instance['echo'] = 0; | |
| 42 | + $instance['raw'] = 0; | |
| 43 | + $list = pll_the_languages( $instance ); | |
| 41 | 44 | |
| 42 | - if ( $list = pll_the_languages( array_merge( $instance, array( 'echo' => 0 ) ) ) ) { | |
| 45 | + if ( $list ) { | |
| 43 | 46 | $title = empty( $instance['title'] ) ? '' : $instance['title']; |
| 44 | 47 | |
| 45 | 48 | /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ |
| 46 | 49 | $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); |
| @@ -66,9 +69,9 @@ | ||
| 66 | 69 | /** This filter is documented in wp-includes/widgets/class-wp-nav-menu-widget.php */ |
| 67 | 70 | $format = apply_filters( 'navigation_widgets_format', $format ); |
| 68 | 71 | |
| 69 | 72 | if ( 'html5' === $format ) { |
| 70 | - echo '<nav role="navigation" aria-label="' . esc_attr( $aria_label ) . '">'; | |
| 73 | + echo '<nav aria-label="' . esc_attr( $aria_label ) . '">'; | |
| 71 | 74 | } |
| 72 | 75 | |
| 73 | 76 | echo "<ul>\n" . $list . "</ul>\n"; // phpcs:ignore WordPress.Security.EscapeOutput |
| 74 | 77 | |