Plugin Directory

Changeset 1356638


Ignore:
Timestamp:
02/23/2016 04:35:33 PM (10 years ago)
Author:
maxchirkov
Message:

Fixes: mortgage calculator widget not inheriting default settings.

Location:
simple-real-estate-pack-4/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • simple-real-estate-pack-4/trunk/includes/srp-widgets.php

    r1226366 r1356638  
    1616        $srp_scripts = true;
    1717
    18         $width = null;
    19         $interest_rate = null;
    20 
    21         extract($args);
    22 
    23         $price_of_home = (isset($instance['price_of_home']) && !empty($instance['price_of_home'])) ? $instance['price_of_home'] : null;
    24         $down_payment = (isset($instance['down_payment']) && !empty($instance['down_payment'])) ? $instance['down_payment'] : null;
    25         $mortgage_term = (isset($instance['mortgage_term']) && !empty($instance['mortgage_term'])) ? $instance['mortgage_term'] : null;
    26 
    27         //check widget-related variables
    28         //since we allow to embed widgets into content where these vars don't exist
    29         $before_title = ( isset($before_title) ) ? $before_title : '';
    30         $after_title = ( isset($after_title) ) ? $after_title : '';
    31         $before_widget = ( isset($before_widget) ) ? $before_widget : '';
    32         $after_widget = ( isset($after_widget) ) ? $after_widget : '';
     18        $width = null;
     19        $interest_rate = null;
     20
     21        extract($args);
     22
     23        if (!$options = get_option('srp_mortgage_calc_options'))
     24        {
     25            $options = _default_settings_MortgageCalc();
     26        }
     27
     28        $instance = array_merge((array)$instance, (array)$options);
     29
     30        $price_of_home = (isset($instance['price_of_home']) && !empty($instance['price_of_home'])) ? $instance['price_of_home'] : null;
     31        $down_payment = (isset($instance['down_payment']) && !empty($instance['down_payment'])) ? $instance['down_payment'] : null;
     32        $mortgage_term = (isset($instance['mortgage_term']) && !empty($instance['mortgage_term'])) ? $instance['mortgage_term'] : null;
     33
     34        //check widget-related variables
     35        //since we allow to embed widgets into content where these vars don't exist
     36        $before_title = ( isset($before_title) ) ? $before_title : '';
     37        $after_title = ( isset($after_title) ) ? $after_title : '';
     38        $before_widget = ( isset($before_widget) ) ? $before_widget : '';
     39        $after_widget = ( isset($after_widget) ) ? $after_widget : '';
    3340
    3441        $title = apply_filters('srp_MortgageCalc', empty($instance['title']) ? '' : $instance['title']);
    3542        if ( !empty( $title ) ) { $title = $before_title . $title . $after_title; }
    3643
    37         $interest_rate = ( $interest_rate ) ?
    38                             $interest_rate :
    39                             (isset($instance['interest_rate']) && !empty($instance['interest_rate'])) ?
    40                                 srp_get_option('annual_interest_rate', $instance['interest_rate']) :
    41                                 null;
    42 
    43         if(isset($instance['width']) && !empty($instance['width'])){ $width = 'style="width:'.$instance['width'].'px"'; }
    44 
    45                 if(!$options = get_option('srp_mortgage_calc_options')){
    46                     $options = _default_settings_MortgageCalc();
    47                 }
    48                             $output = $before_widget . $title . '
     44        $interest_rate = ( $interest_rate ) ?
     45                $interest_rate :
     46                (isset($instance['interest_rate']) && !empty($instance['interest_rate'])) ?
     47                        srp_get_option('annual_interest_rate', $instance['interest_rate']) :
     48                        null;
     49
     50        if(isset($instance['width']) && !empty($instance['width'])){ $width = 'style="width:'.$instance['width'].'px"'; }
     51
     52
     53        $output = $before_widget . $title . '
    4954                            <div class="srp_MortgageCalcwidget" ' . $width . '>
    5055                <table class="srp_table">
  • simple-real-estate-pack-4/trunk/readme.txt

    r1226388 r1356638  
    44Tags: mortgage, mortgage calculator, real estate, realty, widget, plugin, listing, AJAX, homes, neighborhood, schools, yelp, zillow, map, trulia, altos, charts, statistics, real estate market
    55Requires at least: 3.0
    6 Tested up to: 4.3
    7 Stable tag: 1.4.2
     6Tested up to: 4.4.2
     7Stable tag: 1.4.3
    88
    99Package of real estate tools and widgets designed specifically for real estate industry blogs and sites.
     
    217217== Changelog ==
    218218
     219**Version 1.4.3**
     220- Fixes: mortgage calculator widget not inheriting default settings.
     221
    219222**Version 1.4.1**
    220223- WordPress 4.3 compatibility update (deprecated widget constructors).
  • simple-real-estate-pack-4/trunk/srp.php

    r1226366 r1356638  
    44Plugin URI: http://www.phoenixhomes.com/tech/simple-real-estate-pack
    55Description: Package of real estate tools and widgets designed specifically for real estate industry blogs and sites. Includes mortgage and home affordability calculators, closing cost estimator, live mortgage rates, Trulia statistical graphs, local schools and other features.
    6 Version: 1.4.1
     6Version: 1.4.3
    77Author: Max Chirkov
    88Author URI: http://www.PhoenixHomes.com
Note: See TracChangeset for help on using the changeset viewer.