# polylang/0.3.1/widget.php

Polylang, version 0.3.1. 20 lines.

- Page: https://pluginprobe.com/plugins/polylang/0.3.1/code/widget.php
- Raw: https://pluginprobe.com/plugins/polylang/0.3.1/raw/widget.php
- Modified: 2011-09-22T14:35:14+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/polylang/0.3.1/code/widget.php#L10-L20`.

```php
<?php

class Polylang_Widget extends WP_Widget {
	function __construct() {
		$widget_ops = array( 'description' => __( 'Displays a language switcher', 'polylang') );
		parent::__construct('polylang', __('Language Switcher', 'polylang'), $widget_ops);
	}

	function widget($args, $instance) {
		extract( $args );

		echo "$before_widget\n";
		do_action('the_languages');
		echo "$after_widget\n";
	}

} // Class Polylang_Widget

?>

```
