Plugin Directory

Changeset 2937808


Ignore:
Timestamp:
07/12/2023 04:03:43 PM (3 years ago)
Author:
henryp
Message:

fixed some deprecated php warnings on the widget

Location:
donation-thermometer/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • donation-thermometer/trunk/donation_therm.php

    r2856297 r2937808  
    44Plugin URI: https://rhewlif.xyz/thermometer
    55Description: Displays customisable thermometers for tracking donations using the shortcode <code>[thermometer raised=?? target=??]</code>. Shortcodes for raised/target/percentage text values are also available for posts/pages/text widgets: <code>[therm_r]</code> / <code>[therm_t]</code> / <code>[therm_%]</code>.
    6 Version: 2.2
     6Version: 2.2.1
    77Author: Henry Patton
    88Text Domain: donation-thermometer
     
    266266    }
    267267
    268     if (! (is_numeric($input['decimals']))){
    269         $output['decimals'] = $thermDefaults['decimals'];
     268    if ($input['decimals']){
     269        if (! (is_numeric($input['decimals']))){
     270            $output['decimals'] = $thermDefaults['decimals'];
     271        }
    270272    }
    271273
  • donation-thermometer/trunk/includes/therm_settings.php

    r2856297 r2937808  
    232232    $value = (isset(get_option('thermometer_options')[$options['type']])) ? esc_html(get_option('thermometer_options')[$options['type']]) : $options['default'];
    233233    echo '<input id="'.$options['type'].'" type="number" step="1" name="thermometer_options['.$options['type'].']" value="'.sanitize_text_field($value).'" />';
    234     echo ' '.__('number of decimal places', 'donation-thermometer').' (<code>decimals=2</code>)';
     234    echo ' '.__('number of decimal places', 'donation-thermometer').' (<code>decimals=0</code>)';
    235235    echo '</div>';
    236236}
  • donation-thermometer/trunk/includes/therm_widget.php

    r2856297 r2937808  
    1515}
    1616$decsep = (self::get_thermometer_widget_option('decsep') == ', (comma)') ? ',' : '.';
    17 $decimals = self::get_thermometer_widget_option('decimals');
     17$decimals = intval(self::get_thermometer_widget_option('decimals'));
    1818$raisedA = explode(';',self::get_thermometer_widget_option('raised_string'));
    1919if ($decsep == ','){
     
    3737
    3838if($trailing == 'false'){
     39
    3940    echo esc_html($currency.number_format($target,$decimals,$decsep,$sep));
    4041}
  • donation-thermometer/trunk/includes/therm_widget_setup.php

    r2856297 r2937808  
    3737
    3838    public static function get_thermometer_widget_option($option, $default=NULL ) {
    39         global $defaults;
    40         $opts = wp_parse_args( get_option('thermometer_options',$defaults), $defaults);
     39        global $thermDefaults;
     40        $opts = wp_parse_args( get_option('thermometer_options'), $thermDefaults);
    4141        //$opts = self::get_thermometer_widget_options($widget_id);
    4242
  • donation-thermometer/trunk/readme.txt

    r2856297 r2937808  
    44Tags: donate, donation, thermometer, progress, tracker, fundraising, funds, gift, aid, money, charity, non-profit, counter, meter, goal, custom
    55Requires at least: 4.6
    6 Tested up to: 6.1
    7 Stable tag: 2.2
     6Tested up to: 6.2.2
     7Stable tag: 2.2.1
    88Requires PHP: 5.2
    99License: GPL3
     
    7676
    7777== Changelog ==
     78
     79= 2.2.1 =
     80* Fixed some deprecated warnings.
    7881
    7982= 2.2 =
Note: See TracChangeset for help on using the changeset viewer.