/**
* Constructor. Sets up the properties.
*
* @since 3.0.0
*/
public function __construct()
{
parent::__construct('Mlp_Widget', __('Language Switcher', 'multilingual-press'), ['classname' => 'mlp_widget', 'description' => __('MultilingualPress Translations', 'multilingual-press'), 'customize_selective_refresh' => true]);
// TODO: With WordPress 4.6 + 2, inject an asset manager instance.
if (!isset($this->asset_manager)) {
$this->asset_manager = MultilingualPress::resolve('multilingualpress.asset_manager');
}
// TODO: With WordPress 4.6 + 2, inject a view instance.
if (!isset($this->view)) {
$this->view = new WidgetView();
}
// Enqueue style if front end and widget is active (ei.e., it appears in a sidebar) or if in Customizer preview.
if (!is_admin() && is_active_widget(false, false, $this->id_base) || is_customize_preview()) {
$this->enqueue_style();
}
}