| @@ -2,10 +2,12 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * @package Polylang |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | +use WP_Syntex\Polylang\Widgets; | |
| 6 | 7 | use WP_Syntex\Polylang\REST\Request; |
| 7 | 8 | use WP_Syntex\Polylang\Capabilities\Capabilities; |
| 9 | +use WP_Syntex\Polylang\Switcher\Assets as Switcher_Assets; | |
| 8 | 10 | |
| 9 | 11 | /** |
| 10 | 12 | * Base class for both admin and frontend |
| 11 | 13 | * |
| @@ -115,14 +117,14 @@ | ||
| 115 | 117 | * |
| 116 | 118 | * @return void |
| 117 | 119 | */ |
| 118 | 120 | public function widgets_init() { |
| 119 | - register_widget( 'PLL_Widget_Languages' ); | |
| 121 | + register_widget( new Widgets\Languages( $this ) ); | |
| 120 | 122 | |
| 121 | 123 | // Overwrites the calendar widget to filter posts by language |
| 122 | 124 | if ( ! defined( 'PLL_WIDGET_CALENDAR' ) || PLL_WIDGET_CALENDAR ) { |
| 123 | - unregister_widget( 'WP_Widget_Calendar' ); | |
| 124 | - register_widget( 'PLL_Widget_Calendar' ); | |
| 125 | + unregister_widget( WP_Widget_Calendar::class ); | |
| 126 | + register_widget( Widgets\Calendar::class ); | |
| 125 | 127 | } |
| 126 | 128 | } |
| 127 | 129 | |
| 128 | 130 | /** |