Plugin Directory

Changeset 2199014


Ignore:
Timestamp:
11/22/2019 05:43:57 PM (6 years ago)
Author:
halgatewood
Message:

More cleanups on aisle 3

Location:
awesome-weather
Files:
73 added
3 edited

Legend:

Unmodified
Added
Removed
  • awesome-weather/trunk/awesome-weather.php

    r2198985 r2199014  
    66Author: Hal Gatewood
    77Author URI: https://www.halgatewood.com
    8 Version: 3.0
     8Version: 3.0.2
    99Text Domain: awesome-weather
    1010Domain Path: /languages
     
    4545// SETUP
    4646function awesome_weather_setup()
     47{   
     48    if( is_admin() ) add_action(    'admin_menu', 'awesome_weather_setting_page_menu' );
     49}
     50add_action('plugins_loaded', 'awesome_weather_setup', 99999, 0);
     51
     52
     53// LANGUAGES
     54function awesome_weather_setup_locale()
    4755{
    4856    $locale = apply_filters('plugin_locale', get_locale(), 'awesome-weather'); 
    4957    $mofile = WP_LANG_DIR . '/awesome-weather/awesome-weather-' . $locale . '.mo';
    50  
     58
    5159    if( file_exists( $mofile ) )
    5260    {
     
    5765        load_plugin_textdomain( 'awesome-weather', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
    5866    }
    59    
    60     if( is_admin() )
    61     {
    62         add_action( 'admin_menu', 'awesome_weather_setting_page_menu' );
    63     }
    64 }
    65 add_action('plugins_loaded', 'awesome_weather_setup', 99999, 0);
     67}
     68add_action( 'init', 'awesome_weather_setup_locale' );
    6669
    6770
     
    187190    global $awesome_weather_sizes;
    188191   
     192    if( is_object($atts) ) $atts = (array) $atts;
     193   
     194   
    189195    $add_to_transient                   = '';
    190196    $weather                            = new stdclass;
    191197   
    192198    // DEFAULT SETTINGS
    193     $weather->id                        = isset($atts['id']) ? $atts['id'] : awe_widget_id( $atts, true );
     199    $weather->id                        = isset($atts['id']) ? $atts['id'] : awe_widget_id_new( $atts );
    194200    $weather->error                     = false;
    195     $weather->location                  = isset($atts['location']) ? awesome_weather_prep_location($atts['location']) : '';
     201    $weather->location                  = isset($atts['location']) ? awesome_weather_prep_location( $atts['location'] ) : '';
    196202    $weather->owm_city_id               = isset($atts['owm_city_id']) ? $atts['owm_city_id'] : 0;
    197203   
     
    649655
    650656// CREATE WIDGET ID
     657function awe_widget_id_new( $atts )
     658{
     659    $w = $atts;
     660    return awe_widget_id( $w, true );
     661}
     662
     663
    651664function awe_widget_id( &$weather, $rtn = false )
    652665{
     
    12051218
    12061219
    1207 function awesome_weather_prep_location($text)
     1220function awesome_weather_prep_location( $text )
    12081221{
    1209     $text = stripslashes($text);
    1210     $text = str_replace(array("\xe2\x80\x98", "\xe2\x80\x99", "\xe2\x80\x9c", "\xe2\x80\x9d", "\xe2\x80\x93", "\xe2\x80\x94", "\xe2\x80\xa6"), array("'", "'", '', '', '-', '--', '...'), $text);
    1211     $text = str_replace(array(chr(145), chr(146), chr(147), chr(148), chr(150), chr(151), chr(133)), array("'", "'", '', '', '-', '--', '...'), $text);
     1222    $text = stripslashes( $text );
     1223    $text = str_replace( array("\xe2\x80\x98", "\xe2\x80\x99", "\xe2\x80\x9c", "\xe2\x80\x9d", "\xe2\x80\x93", "\xe2\x80\x94", "\xe2\x80\xa6"), array("'", "'", '', '', '-', '--', '...'), $text);
     1224    $text = str_replace( array(chr(145), chr(146), chr(147), chr(148), chr(150), chr(151), chr(133)), array("'", "'", '', '', '-', '--', '...'), $text);
    12121225    return $text;
    12131226}
  • awesome-weather/trunk/providers/openweathermaps.php

    r2195275 r2199014  
    4040        if( $city_id_from_location )
    4141        {
    42             $weather->owm_city_id = $$city_id_from_location;
     42            $weather->owm_city_id = $city_id_from_location;
    4343        }
    4444        else
  • awesome-weather/trunk/readme.txt

    r2198985 r2199014  
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Finally beautiful weather widgets for your beautiful site.
     11Finally beautiful weather widgets for your beautiful WordPress website.
    1212
    1313== Description ==
     
    7070== Upgrade Notice ==
    7171
    72 I have merged my PRO plugin into this FREE plugin. Enjoy all the new features!
     72At version 3.o, I merged my PRO plugin into this FREE plugin. Enjoy all the new features!
    7373
    7474== Changelog ==
     75
     76= 3.0.2 =
     77- Fix: More locale changes.
     78- Fix: Nasty possible loop cleaned.
     79- Fix: awe_widget_id issue change array to object
    7580
    7681= 3.0.1 =
Note: See TracChangeset for help on using the changeset viewer.