From e91b9b927e5110073dd5685250a568e35a048cd8 Mon Sep 17 00:00:00 2001 From: Zack Katz Date: Fri, 3 Oct 2014 10:36:59 -0600 Subject: [PATCH] 2.0.7 --- inc/functions.php | 12 +++++++----- readme.txt | 8 ++++++++ wunderground.php | 4 ++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index b53595a..44e59fc 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -54,6 +54,7 @@ function wunderground_parse_atts( $passed_atts, $shortcode = 'wunderground' ) { 'datelabel' => 'm/d', 'language' => wunderground_get_language(), 'showdata' => array('search', 'alerts', 'daynames','pop','icon','text', 'conditions', 'date'), + 'hidedata' => array(), ); // Use previous settings as defaults to better support backward compatibility @@ -233,11 +234,8 @@ function wunderground_get_date_format( $format = 'm/d' ) { // Backward compatibility - // Replace placeholder tags with PHP date format - $format = str_replace( '%%weekday%%', 'l', $format ); - $format = str_replace( '%%day%%', 'j', $format ); - $format = str_replace( '%%month%%', 'm', $format ); - $format = str_replace( '%%year%%', 'Y', $format ); + // Remove placeholder tags from v1 + $format = str_replace( array('%%weekday%%', '%%day%%', '%%month%%', '%%year%%' ), '', $format ); // Then we look for the php date() function by matching: // date('[stuff in here]') or date("[stuff in here]") @@ -247,6 +245,10 @@ function wunderground_get_date_format( $format = 'm/d' ) { // End backward compatibility + if( empty( $format ) ) { + $format = $default_format; + } + return apply_filters( 'wunderground_date_format', $format ); } diff --git a/readme.txt b/readme.txt index 5306380..f1ac1c4 100644 --- a/readme.txt +++ b/readme.txt @@ -82,6 +82,10 @@ Wunderground has been very gracious and has provided the plugin with free data - If you are upgrading the plugin, your forecast will look different. Version 2.x made lots of changes as to how the forecast is displayed. If you want to go back after upgrading, you can [download the previous version here](https://downloads.wordpress.org/plugin/wunderground.1.2.5.1.zip). += 2.0.7 on October 3 = +* Fixed: `hidedata` shortcode parameter wasn't working properly +* Modified: Removed support for `%%day%%` `%%month%%` and `%%year%%` placeholder tags + = 2.0.6 on October 3 = * Added: Support for using using settings from Version 1.x as the defaults. This fixes the loss of your configuration if you use the `[forecast]` shortcode with no parameters. * Added: Lithuanian translation @@ -176,6 +180,10 @@ If you are upgrading the plugin, your forecast will look different. Version 2.x == Upgrade Notice == += 2.0.7 on October 3 = +* Fixed: `hidedata` shortcode parameter wasn't working properly +* Modified: Removed support for `%%day%%` `%%month%%` and `%%year%%` placeholder tags + = 2.0.6 on October 3 = * Added: Support for using using settings from Version 1.x as the defaults. This fixes the loss of your configuration if you use the `[forecast]` shortcode with no parameters. diff --git a/wunderground.php b/wunderground.php index 3dcdbf3..17b2aec 100644 --- a/wunderground.php +++ b/wunderground.php @@ -2,7 +2,7 @@ /* * Plugin Name: Weather Underground * Description: Get accurate and beautiful weather forecasts powered by Wunderground.com for your content or your sidebar. -* Version: 2.0.6 +* Version: 2.0.7 * License: GPLv2 or later * License URI: http://www.gnu.org/licenses/gpl-2.0.html * Author: Katz Web Services, Inc. @@ -13,7 +13,7 @@ class Wunderground_Plugin { - const version = '2.0.6'; + const version = '2.0.7'; var $logger; var $is_debug = false;