| @@ -1,16 +1,16 @@ | ||
| 1 | 1 | <?php |
| 2 | + | |
| 2 | 3 | /** |
| 3 | - * The Map widget | |
| 4 | - * Displays a map of geolocalized posts | |
| 5 | - * | |
| 6 | - * @package event-post | |
| 7 | - */ | |
| 4 | + * The Map widget | |
| 5 | + * Displays a map of geolocalized posts | |
| 6 | + * | |
| 7 | + */ | |
| 8 | 8 | class EventPost_Map extends WP_Widget { |
| 9 | 9 | var $defaults; |
| 10 | 10 | function __construct() { |
| 11 | 11 | global $EventPost; |
| 12 | - parent::__construct(false, __( 'Events Map', 'event-post' ),array('description'=>__( 'Map of events posts', 'event-post' ))); | |
| 12 | + parent::__construct(false, __( 'Events map', 'event-post' ),array('description'=>__( 'Map of events posts', 'event-post' ))); | |
| 13 | 13 | $this->defaults = array( |
| 14 | 14 | 'numberposts' => '', |
| 15 | 15 | 'widgettitle' => '', |
| 16 | 16 | 'cat' => '', |
| @@ -133,9 +133,9 @@ | ||
| 133 | 133 | |
| 134 | 134 | <p> |
| 135 | 135 | <label for="<?php echo $this->get_field_id('cat'); ?>"> |
| 136 | 136 | <span class="dashicons dashicons-category"></span> |
| 137 | - <?php _e('Only in:','event-post'); ?> | |
| 137 | + <?php _e('Only in :','event-post'); ?> | |
| 138 | 138 | <select class="widefat" id="<?php echo $this->get_field_id('cat'); ?>" name="<?php echo $this->get_field_name('cat'); ?>"> |
| 139 | 139 | <option value=''><?php _e('All categories','event-post') ?></option> |
| 140 | 140 | <?php |
| 141 | 141 | $cats = get_categories(); |
| @@ -148,9 +148,9 @@ | ||
| 148 | 148 | |
| 149 | 149 | <p> |
| 150 | 150 | <label for="<?php echo $this->get_field_id('tag'); ?>"> |
| 151 | 151 | <span class="dashicons dashicons-tag"></span> |
| 152 | - <?php _e('Only in:','event-post'); ?> | |
| 152 | + <?php _e('Only in :','event-post'); ?> | |
| 153 | 153 | <select class="widefat" id="<?php echo $this->get_field_id('tag'); ?>" name="<?php echo $this->get_field_name('tag'); ?>"> |
| 154 | 154 | <option value=''><?php _e('All tags','event-post') ?></option> |
| 155 | 155 | <?php |
| 156 | 156 | $tags = get_tags(); |
| @@ -212,9 +212,13 @@ | ||
| 212 | 212 | <option value="<?php |
| 213 | 213 | if ($EventPost->settings['tile'] != $map['id']) { |
| 214 | 214 | echo $map['id']; |
| 215 | 215 | } |
| 216 | - ?>" <?php selected($instance['tile'], $id, true);?>> | |
| 216 | + ?>" <?php | |
| 217 | + if ($instance['title'] == $map['id']) { | |
| 218 | + echo'selected'; | |
| 219 | + } | |
| 220 | + ?>> | |
| 217 | 221 | <?php echo $map['name']; ?><?php |
| 218 | 222 | if ($EventPost->settings['tile'] == $map['id']) { |
| 219 | 223 | echo' (default)'; |
| 220 | 224 | } |
| @@ -235,5 +239,5 @@ | ||
| 235 | 239 | <?php endforeach; ?> |
| 236 | 240 | <?php |
| 237 | 241 | } |
| 238 | 242 | |
| 239 | -} | |
| 243 | +} | |