1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
<?php
namespace SIW\Widgets;
class Map extends Widget {
protected $widget_id ='map';
protected $widget_dashicon = 'location-alt';
protected function set_widget_properties() {
$this->widget_name = __( 'Interactieve kaart', 'siw');
$this->widget_description = __( 'Toont interactieve kaart', 'siw' );
}
public function get_widget_form() {
$widget_form = [
'title' => [
'type' => 'text',
'label' => __( 'Titel', 'siw'),
],
'map' => [
'type' => 'select',
'label' => __( 'Kaart', 'siw' ),
'prompt' => __( 'Kies een kaart', 'siw' ),
'options' => siw_get_interactive_maps(),
],
];
return $widget_form;
}
public function get_content( array $instance, array $args, array $template_vars, string $css_name ) {
return siw_generate_interactive_map( $instance['map'] );
}
}