Awesome Weather Widget - Version 1.5.10

Version Description

  • PHP7 Support
  • New lat and lon attributes to get weather by coordinates
Download this release

Release Info

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

Code changes from version 1.5.9 to 1.5.10

Files changed (3) hide show
  1. awesome-weather.php +10 -1
  2. readme.txt +7 -3
  3. widget.php +1 -1
awesome-weather.php CHANGED
@@ -5,11 +5,12 @@ Plugin URI: https://halgatewood.com/awesome-weather
5
  Description: A weather widget that actually looks cool
6
  Author: Hal Gatewood
7
  Author URI: https://www.halgatewood.com
8
- Version: 1.5.9
9
  Text Domain: awesome-weather
10
  Domain Path: /languages
11
 
12
 
 
13
  FILTERS AVAILABLE:
14
  https://halgatewood.com/docs/plugins/awesome-weather-widget/available-filters
15
 
@@ -141,6 +142,14 @@ function awesome_weather_logic( $atts )
141
  }
142
 
143
 
 
 
 
 
 
 
 
 
144
  // TRANSIENT NAME
145
  $weather_transient_name = 'awe_' . $city_name_slug . "_" . $days_to_show . "_" . strtolower($units) . '_' . $locale;
146
 
5
  Description: A weather widget that actually looks cool
6
  Author: Hal Gatewood
7
  Author URI: https://www.halgatewood.com
8
+ Version: 1.5.10
9
  Text Domain: awesome-weather
10
  Domain Path: /languages
11
 
12
 
13
+
14
  FILTERS AVAILABLE:
15
  https://halgatewood.com/docs/plugins/awesome-weather-widget/available-filters
16
 
142
  }
143
 
144
 
145
+ // OVERRIDE WITH LONG LAT, WHEN AVAILABLE
146
+ if( isset($atts['lat']) AND isset($atts['lon']) )
147
+ {
148
+ $city_name_slug = str_replace(".","-", $atts['lat']) . "-" . str_replace(".","-", $atts['lon']);
149
+ $api_query = "lat=" . $atts['lat'] . "&lon=" . $atts['lon'];
150
+ }
151
+
152
+
153
  // TRANSIENT NAME
154
  $weather_transient_name = 'awe_' . $city_name_slug . "_" . $days_to_show . "_" . strtolower($units) . '_' . $locale;
155
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: halgatewood
3
  Donate link: https://halgatewood.com/donate/
4
  Tags: widgets, sidebar, shortcode, openweathermap, weather, weather widget, forecast, global, temp, local weather,local forecast
5
  Requires at least: 3.5
6
- Tested up to: 4.4
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -12,7 +12,7 @@ Finally beautiful weather widgets for your beautiful site.
12
 
13
  == Description ==
14
 
15
- >[Pro Version](https://halgatewood.com/downloads/awesome-weather-widget-pro/) available. Weather icons, 5 New Layouts and Custom Templates, Weather by Yahoo!, User Location Detection and more!
16
 
17
  This plugin allows you to easily add super clean (and awesome) weather widgets to your site.
18
 
@@ -27,7 +27,7 @@ Use the built in widget with all of its marvelous settings or add it to a page o
27
  Easiest:
28
  `[awesome-weather location="Oklahoma City"]`
29
 
30
- All Available Parameters:
31
  `[awesome-weather location="Montreal" units="F" owm_city_id="6077243" size="tall" override_title="MTL" forecast_days="3" hide_stats="1" background="http://urltoanimage.jpg" custom_bg_color="#cccccc" inline_style="width: 200px; margin: 20px; float: left;" background_by_weather="1" text_color="#000" locale="fr"]`
32
 
33
  = Settings =
@@ -188,6 +188,10 @@ Changed API endpoints. Might not find weather without update.
188
 
189
  == Changelog ==
190
 
 
 
 
 
191
  = 1.5.9 =
192
  * Updated language to allow for custom translations located at: wp-content/languages/awesome-weather/awesome-weather-{locale}.mo
193
  * Checkbox to hide the attribution in the widget settings or use shortcode attribute hide_attribution="1"
3
  Donate link: https://halgatewood.com/donate/
4
  Tags: widgets, sidebar, shortcode, openweathermap, weather, weather widget, forecast, global, temp, local weather,local forecast
5
  Requires at least: 3.5
6
+ Tested up to: 4.6
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
13
  == Description ==
14
 
15
+ >[Pro Version](https://halgatewood.com/downloads/awesome-weather-widget-pro/) available. Weather icons, 5 New Layouts and Custom Templates, Weather by Yahoo! (no API key required), User Location Detection and more!
16
 
17
  This plugin allows you to easily add super clean (and awesome) weather widgets to your site.
18
 
27
  Easiest:
28
  `[awesome-weather location="Oklahoma City"]`
29
 
30
+ [All Available Parameters](https://halgatewood.com/docs/plugins/awesome-weather-widget/using-shortcode):
31
  `[awesome-weather location="Montreal" units="F" owm_city_id="6077243" size="tall" override_title="MTL" forecast_days="3" hide_stats="1" background="http://urltoanimage.jpg" custom_bg_color="#cccccc" inline_style="width: 200px; margin: 20px; float: left;" background_by_weather="1" text_color="#000" locale="fr"]`
32
 
33
  = Settings =
188
 
189
  == Changelog ==
190
 
191
+ = 1.5.10 =
192
+ * PHP7 Support
193
+ * New lat and lon attributes to get weather by coordinates
194
+
195
  = 1.5.9 =
196
  * Updated language to allow for custom translations located at: wp-content/languages/awesome-weather/awesome-weather-{locale}.mo
197
  * Checkbox to hide the attribution in the widget settings or use shortcode attribute hide_attribution="1"
widget.php CHANGED
@@ -3,7 +3,7 @@
3
  // AWESOME WEATHER WIDGET, WIDGET CLASS, SO MANY WIDGETS
4
  class AwesomeWeatherWidget extends WP_Widget
5
  {
6
- function AwesomeWeatherWidget() { parent::__construct(false, $name = 'Awesome Weather Widget'); }
7
 
8
  function widget($args, $instance)
9
  {
3
  // AWESOME WEATHER WIDGET, WIDGET CLASS, SO MANY WIDGETS
4
  class AwesomeWeatherWidget extends WP_Widget
5
  {
6
+ function __construct() { parent::__construct(false, $name = 'Awesome Weather Widget'); }
7
 
8
  function widget($args, $instance)
9
  {