Awesome Weather Widget - Version 1.2.1

Version Description

  • Background Image Option in widget
Download this release

Release Info

Developer halgatewood
Plugin Icon 128x128 Awesome Weather Widget
Version 1.2.1
Comparing to
See all releases

Code changes from version 1.2 to 1.2.1

Files changed (2) hide show
  1. awesome-weather.php +10 -2
  2. readme.txt +3 -0
awesome-weather.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://halgatewood.com/awesome-weather
5
  Description: A weather widget that actually looks cool
6
  Author: Hal Gatewood
7
  Author URI: http://www.halgatewood.com
8
- Version: 1.2
9
 
10
 
11
  FILTERS AVAILABLE:
@@ -289,9 +289,10 @@ class AwesomeWeatherWidget extends WP_Widget
289
  $forecast_days = isset($instance['forecast_days']) ? $instance['forecast_days'] : false;
290
  $hide_stats = (isset($instance['hide_stats']) AND $instance['hide_stats'] == 1) ? 1 : 0;
291
  $show_link = (isset($instance['show_link']) AND $instance['show_link'] == 1) ? 1 : 0;
 
292
 
293
  echo $before_widget;
294
- echo awesome_weather_logic( array( 'location' => $location, 'override_title' => $override_title, 'size' => $size, 'units' => $units, 'forecast_days' => $forecast_days, 'hide_stats' => $hide_stats, 'show_link' => $show_link));
295
  echo $after_widget;
296
  }
297
 
@@ -305,6 +306,7 @@ class AwesomeWeatherWidget extends WP_Widget
305
  $instance['forecast_days'] = strip_tags($new_instance['forecast_days']);
306
  $instance['hide_stats'] = strip_tags($new_instance['hide_stats']);
307
  $instance['show_link'] = strip_tags($new_instance['show_link']);
 
308
  return $instance;
309
  }
310
 
@@ -319,6 +321,7 @@ class AwesomeWeatherWidget extends WP_Widget
319
  $forecast_days = isset($instance['forecast_days']) ? esc_attr($instance['forecast_days']) : 5;
320
  $hide_stats = (isset($instance['hide_stats']) AND $instance['hide_stats'] == 1) ? 1 : 0;
321
  $show_link = (isset($instance['show_link']) AND $instance['show_link'] == 1) ? 1 : 0;
 
322
 
323
  ?>
324
  <p>
@@ -358,6 +361,11 @@ class AwesomeWeatherWidget extends WP_Widget
358
  </select>
359
  </p>
360
 
 
 
 
 
 
361
  <p>
362
  <label for="<?php echo $this->get_field_id('hide_stats'); ?>"><?php _e('Hide Stats:'); ?></label> &nbsp;
363
  <input id="<?php echo $this->get_field_id('hide_stats'); ?>" name="<?php echo $this->get_field_name('hide_stats'); ?>" type="checkbox" value="1" <?php if($hide_stats) echo ' checked="checked"'; ?> />
5
  Description: A weather widget that actually looks cool
6
  Author: Hal Gatewood
7
  Author URI: http://www.halgatewood.com
8
+ Version: 1.2.1
9
 
10
 
11
  FILTERS AVAILABLE:
289
  $forecast_days = isset($instance['forecast_days']) ? $instance['forecast_days'] : false;
290
  $hide_stats = (isset($instance['hide_stats']) AND $instance['hide_stats'] == 1) ? 1 : 0;
291
  $show_link = (isset($instance['show_link']) AND $instance['show_link'] == 1) ? 1 : 0;
292
+ $background = isset($instance['background']) ? $instance['background'] : false;
293
 
294
  echo $before_widget;
295
+ echo awesome_weather_logic( array( 'location' => $location, 'override_title' => $override_title, 'size' => $size, 'units' => $units, 'forecast_days' => $forecast_days, 'hide_stats' => $hide_stats, 'show_link' => $show_link, 'background' => $background ));
296
  echo $after_widget;
297
  }
298
 
306
  $instance['forecast_days'] = strip_tags($new_instance['forecast_days']);
307
  $instance['hide_stats'] = strip_tags($new_instance['hide_stats']);
308
  $instance['show_link'] = strip_tags($new_instance['show_link']);
309
+ $instance['background'] = strip_tags($new_instance['background']);
310
  return $instance;
311
  }
312
 
321
  $forecast_days = isset($instance['forecast_days']) ? esc_attr($instance['forecast_days']) : 5;
322
  $hide_stats = (isset($instance['hide_stats']) AND $instance['hide_stats'] == 1) ? 1 : 0;
323
  $show_link = (isset($instance['show_link']) AND $instance['show_link'] == 1) ? 1 : 0;
324
+ $background = isset($instance['background']) ? esc_attr($instance['background']) : "";
325
 
326
  ?>
327
  <p>
361
  </select>
362
  </p>
363
 
364
+ <p>
365
+ <label for="<?php echo $this->get_field_id('background'); ?>"><?php _e('Background Image:'); ?></label>
366
+ <input class="widefat" id="<?php echo $this->get_field_id('background'); ?>" name="<?php echo $this->get_field_name('background'); ?>" type="text" value="<?php echo $background; ?>" />
367
+ </p>
368
+
369
  <p>
370
  <label for="<?php echo $this->get_field_id('hide_stats'); ?>"><?php _e('Hide Stats:'); ?></label> &nbsp;
371
  <input id="<?php echo $this->get_field_id('hide_stats'); ?>" name="<?php echo $this->get_field_name('hide_stats'); ?>" type="checkbox" value="1" <?php if($hide_stats) echo ' checked="checked"'; ?> />
readme.txt CHANGED
@@ -65,6 +65,9 @@ Changed API endpoints. Might not find weather without update.
65
 
66
  == Changelog ==
67
 
 
 
 
68
  = 1.2 =
69
  * Background Image Option
70
 
65
 
66
  == Changelog ==
67
 
68
+ = 1.2.1 =
69
+ * Background Image Option in widget
70
+
71
  = 1.2 =
72
  * Background Image Option
73