@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /* Exit if accessed directly. */ |
4 | -if ( ! defined( 'ABSPATH' ) ) { exit; } |
|
4 | +if ( ! defined('ABSPATH')) { exit; } |
|
5 | 5 | |
6 | -if ( ! class_exists( 'TruliaWidgets' ) ) { |
|
6 | +if ( ! class_exists('TruliaWidgets')) { |
|
7 | 7 | |
8 | 8 | /** |
9 | 9 | * TruliaWidgets class. |
@@ -48,10 +48,10 @@ discard block |
||
48 | 48 | * @param string $iframe_id (default: '') |
49 | 49 | * @return void |
50 | 50 | */ |
51 | - public function trulia_iframe_id( $iframe_id = '' ) { |
|
51 | + public function trulia_iframe_id($iframe_id = '') { |
|
52 | 52 | |
53 | - if( '' !== $iframe_id ) { |
|
54 | - return sanitize_html_class( $iframe_id ) . '-iframe'; |
|
53 | + if ('' !== $iframe_id) { |
|
54 | + return sanitize_html_class($iframe_id) . '-iframe'; |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | } |
@@ -63,10 +63,10 @@ discard block |
||
63 | 63 | * @param string $widget_name (default: '') |
64 | 64 | * @return void |
65 | 65 | */ |
66 | - public function trulia_iframe_class( $widget_name = '' ) { |
|
66 | + public function trulia_iframe_class($widget_name = '') { |
|
67 | 67 | |
68 | - if( '' !== $widget_name ) { |
|
69 | - return 'trulia trulia-iframe trulia-' . sanitize_html_class( $widget_name ) . '-iframe'; |
|
68 | + if ('' !== $widget_name) { |
|
69 | + return 'trulia trulia-iframe trulia-' . sanitize_html_class($widget_name) . '-iframe'; |
|
70 | 70 | } else { |
71 | 71 | return 'trulia-iframe'; |
72 | 72 | } |
@@ -83,8 +83,8 @@ discard block |
||
83 | 83 | * @param string $email (default: '') |
84 | 84 | * @return void |
85 | 85 | */ |
86 | - public function get_community_advice_widget( $iframe_id = '', $display_answers, $title, $email = '' ) { |
|
87 | - echo '<iframe id="'. $this->trulia_iframe_id( $iframe_id ) .'" class="'. $this->trulia_iframe_class( 'community-advice' ) .'" src="https://synd.trulia.com/tools/expert-community-advice/embedded?params%5Bwhose_answer%5D=¶ms%5Bdisplay_answers%5D=true¶ms%5Btitle%5D=Expert+Community+Advice¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=350¶ms%5Bguid%5D=58237a792f772"></iframe>'; |
|
86 | + public function get_community_advice_widget($iframe_id = '', $display_answers, $title, $email = '') { |
|
87 | + echo '<iframe id="' . $this->trulia_iframe_id($iframe_id) . '" class="' . $this->trulia_iframe_class('community-advice') . '" src="https://synd.trulia.com/tools/expert-community-advice/embedded?params%5Bwhose_answer%5D=¶ms%5Bdisplay_answers%5D=true¶ms%5Btitle%5D=Expert+Community+Advice¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=350¶ms%5Bguid%5D=58237a792f772"></iframe>'; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | * @param string $email (default: '') |
99 | 99 | * @return void |
100 | 100 | */ |
101 | - public function get_rent_buy_calc_widget( $iframe_id = '', $location, $width, $height, $email = '' ) { |
|
102 | - echo '<iframe id="'. $this->trulia_iframe_id( $iframe_id ) .'" class="'. $this->trulia_iframe_class( 'rent-buy-calc' ) .'" src="https://synd.trulia.com/tools/rent-vs-buy-calculator/embedded?params%5Btool_metro_area%5D=31084¶ms%5Btitle%5D=Rent+vs.+Buy+Calculator¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=600¶ms%5Bheight%5D=300¶ms%5Bguid%5D=582379f9264e8"></iframe>'; |
|
101 | + public function get_rent_buy_calc_widget($iframe_id = '', $location, $width, $height, $email = '') { |
|
102 | + echo '<iframe id="' . $this->trulia_iframe_id($iframe_id) . '" class="' . $this->trulia_iframe_class('rent-buy-calc') . '" src="https://synd.trulia.com/tools/rent-vs-buy-calculator/embedded?params%5Btool_metro_area%5D=31084¶ms%5Btitle%5D=Rent+vs.+Buy+Calculator¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=600¶ms%5Bheight%5D=300¶ms%5Bguid%5D=582379f9264e8"></iframe>'; |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -113,9 +113,9 @@ discard block |
||
113 | 113 | * @param string $email (default: '') |
114 | 114 | * @return void |
115 | 115 | */ |
116 | - public function get_rental_market_widget( $iframe_id = '', $location, $width, $height, $email = '' ) { |
|
116 | + public function get_rental_market_widget($iframe_id = '', $location, $width, $height, $email = '') { |
|
117 | 117 | |
118 | - echo '<iframe id="'. $this->trulia_iframe_id( $iframe_id ) .'" class="'. $this->trulia_iframe_class( 'rental-market' ) .'" src="https://synd.trulia.com/tools/rental-market-monitor/embedded?params%5Blocation%5D=Los+Angeles%2C+CA¶ms%5BlocationId%5D=22637¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Btitle%5D=Rental+Market+Monitor¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=250¶ms%5Bguid%5D=582379637cf2e"></iframe>'; |
|
118 | + echo '<iframe id="' . $this->trulia_iframe_id($iframe_id) . '" class="' . $this->trulia_iframe_class('rental-market') . '" src="https://synd.trulia.com/tools/rental-market-monitor/embedded?params%5Blocation%5D=Los+Angeles%2C+CA¶ms%5BlocationId%5D=22637¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Btitle%5D=Rental+Market+Monitor¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=250¶ms%5Bguid%5D=582379637cf2e"></iframe>'; |
|
119 | 119 | |
120 | 120 | } |
121 | 121 | |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | * @param string $email (default: '') |
132 | 132 | * @return void |
133 | 133 | */ |
134 | - public function get_map_search_widget( $iframe_id = '', $location, $width, $height, $email = '' ) { |
|
135 | - echo '<iframe id="'. $this->trulia_iframe_id( $iframe_id ) .'" class="'. $this->trulia_iframe_class( 'map-search' ) .'" src="https://synd.trulia.com/tools/map-search/embedded?params%5Blocation%5D=West+Hills%2C+CA¶ms%5BlocationId%5D=39307¶ms%5Bagent_id%5D=¶ms%5Bproperty_status%5D=for+sale¶ms%5Btitle%5D=Map+Search¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=600¶ms%5Bheight%5D=300¶ms%5Bguid%5D=582378f4c0432"></iframe>'; |
|
134 | + public function get_map_search_widget($iframe_id = '', $location, $width, $height, $email = '') { |
|
135 | + echo '<iframe id="' . $this->trulia_iframe_id($iframe_id) . '" class="' . $this->trulia_iframe_class('map-search') . '" src="https://synd.trulia.com/tools/map-search/embedded?params%5Blocation%5D=West+Hills%2C+CA¶ms%5BlocationId%5D=39307¶ms%5Bagent_id%5D=¶ms%5Bproperty_status%5D=for+sale¶ms%5Btitle%5D=Map+Search¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=600¶ms%5Bheight%5D=300¶ms%5Bguid%5D=582378f4c0432"></iframe>'; |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | /** |
@@ -146,8 +146,8 @@ discard block |
||
146 | 146 | * @param string $email (default: '') |
147 | 147 | * @return void |
148 | 148 | */ |
149 | - public function get_home_gallery_widget( $iframe_id = '', $location, $width, $height, $email = '' ) { |
|
150 | - echo '<iframe id="'. $this->trulia_iframe_id( $iframe_id ) .'" class="'. $this->trulia_iframe_class( 'home-gallery' ) .'" src="https://synd.trulia.com/tools/home-gallery/embedded?params%5Blocation%5D=Los+Angeles%2C+CA¶ms%5BlocationId%5D=22637¶ms%5Bmin_price%5D=¶ms%5Bmax_price%5D=¶ms%5Bnum_beds%5D=¶ms%5Bnum_baths%5D=¶ms%5Bagent_id%5D=¶ms%5Bspeed%5D=5000¶ms%5Btitle%5D=Home+Gallery¶ms%5Bcolor%5D=green¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=300¶ms%5Bguid%5D=582371b703b0d¶ms%5Bslides_per_page%5D=3&city=Los Angeles&state_code=CA"></iframe>'; |
|
149 | + public function get_home_gallery_widget($iframe_id = '', $location, $width, $height, $email = '') { |
|
150 | + echo '<iframe id="' . $this->trulia_iframe_id($iframe_id) . '" class="' . $this->trulia_iframe_class('home-gallery') . '" src="https://synd.trulia.com/tools/home-gallery/embedded?params%5Blocation%5D=Los+Angeles%2C+CA¶ms%5BlocationId%5D=22637¶ms%5Bmin_price%5D=¶ms%5Bmax_price%5D=¶ms%5Bnum_beds%5D=¶ms%5Bnum_baths%5D=¶ms%5Bagent_id%5D=¶ms%5Bspeed%5D=5000¶ms%5Btitle%5D=Home+Gallery¶ms%5Bcolor%5D=green¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=300¶ms%5Bguid%5D=582371b703b0d¶ms%5Bslides_per_page%5D=3&city=Los Angeles&state_code=CA"></iframe>'; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | * @param string $email (default: '') |
162 | 162 | * @return void |
163 | 163 | */ |
164 | - public function get_home_showcase_widget( $iframe_id = '', $location, $width, $height, $email = '' ) { |
|
165 | - echo '<iframe id="'. $this->trulia_iframe_id( $iframe_id ) .'" class="'. $this->trulia_iframe_class( 'home-showcase' ) .'" src="https://synd.trulia.com/tools/home-showcase/embedded?params%5Blocation%5D=Los+Angeles%2C+CA¶ms%5BlocationId%5D=22637¶ms%5Bmin_price%5D=¶ms%5Bmax_price%5D=¶ms%5Bnum_beds%5D=¶ms%5Bnum_baths%5D=¶ms%5Bagent_id%5D=¶ms%5Bspeed%5D=5000¶ms%5Btitle%5D=My+Listings¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=350¶ms%5Bguid%5D=582370ce64073"></iframe>'; |
|
164 | + public function get_home_showcase_widget($iframe_id = '', $location, $width, $height, $email = '') { |
|
165 | + echo '<iframe id="' . $this->trulia_iframe_id($iframe_id) . '" class="' . $this->trulia_iframe_class('home-showcase') . '" src="https://synd.trulia.com/tools/home-showcase/embedded?params%5Blocation%5D=Los+Angeles%2C+CA¶ms%5BlocationId%5D=22637¶ms%5Bmin_price%5D=¶ms%5Bmax_price%5D=¶ms%5Bnum_beds%5D=¶ms%5Bnum_baths%5D=¶ms%5Bagent_id%5D=¶ms%5Bspeed%5D=5000¶ms%5Btitle%5D=My+Listings¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=350¶ms%5Bguid%5D=582370ce64073"></iframe>'; |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | /** |
@@ -176,8 +176,8 @@ discard block |
||
176 | 176 | * @param string $email (default: '') |
177 | 177 | * @return void |
178 | 178 | */ |
179 | - public function get_homefinder_widget( $iframe_id = '', $location, $width, $height, $email = '' ) { |
|
180 | - echo '<iframe id="'. $this->trulia_iframe_id( $iframe_id ) .'" class="'. $this->trulia_iframe_class( 'homefinder' ) .'" src="https://synd.trulia.com/tools/home-finder/embedded?params%5Blocation%5D=¶ms%5BlocationId%5D=¶ms%5Bcolor%5D=green¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Btitle%5D=Home+Finder¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=350¶ms%5Bguid%5D=58236f71d7732"></iframe>'; |
|
179 | + public function get_homefinder_widget($iframe_id = '', $location, $width, $height, $email = '') { |
|
180 | + echo '<iframe id="' . $this->trulia_iframe_id($iframe_id) . '" class="' . $this->trulia_iframe_class('homefinder') . '" src="https://synd.trulia.com/tools/home-finder/embedded?params%5Blocation%5D=¶ms%5BlocationId%5D=¶ms%5Bcolor%5D=green¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Btitle%5D=Home+Finder¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=350¶ms%5Bguid%5D=58236f71d7732"></iframe>'; |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | /** |
@@ -191,9 +191,9 @@ discard block |
||
191 | 191 | * @param string $email (default: '') |
192 | 192 | * @return void |
193 | 193 | */ |
194 | - public function get_market_monitor_widget( $iframe_id = '', $location, $width, $height, $email = '' ) { |
|
194 | + public function get_market_monitor_widget($iframe_id = '', $location, $width, $height, $email = '') { |
|
195 | 195 | |
196 | - echo '<iframe id="'. $this->trulia_iframe_id( $iframe_id ) .'" class="'. $this->trulia_iframe_class( 'market-monitor' ) .'" src="https://synd.trulia.com/tools/market-monitor/embedded?params%5Blocation%5D=Los+Angeles%2C+CA¶ms%5BlocationId%5D=22637¶ms%5Blisting_price_type%5D=average¶ms%5Bshow_inventory%5D=1¶ms%5Btitle%5D=Market+Monitor¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=250¶ms%5Bguid%5D=58236e004595a"></iframe>'; |
|
196 | + echo '<iframe id="' . $this->trulia_iframe_id($iframe_id) . '" class="' . $this->trulia_iframe_class('market-monitor') . '" src="https://synd.trulia.com/tools/market-monitor/embedded?params%5Blocation%5D=Los+Angeles%2C+CA¶ms%5BlocationId%5D=22637¶ms%5Blisting_price_type%5D=average¶ms%5Bshow_inventory%5D=1¶ms%5Btitle%5D=Market+Monitor¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=250¶ms%5Bguid%5D=58236e004595a"></iframe>'; |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | /** |
@@ -207,9 +207,9 @@ discard block |
||
207 | 207 | * @param mixed $height |
208 | 208 | * @return void |
209 | 209 | */ |
210 | - public function get_affordability_calc_widget( $iframe_id = '', $color, $title, $width, $height, $email = '' ) { |
|
210 | + public function get_affordability_calc_widget($iframe_id = '', $color, $title, $width, $height, $email = '') { |
|
211 | 211 | |
212 | - echo '<iframe id="'. $this->trulia_iframe_id( $iframe_id ) .'" class="'. $this->trulia_iframe_class( 'affordability-calc' ) .'" src="https://synd.trulia.com/tools/affordability-calculator/embedded?params%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Btitle%5D=Affordability+Calculator¶ms%5Bwidth%5D=600¶ms%5Bheight%5D=300¶ms%5Bguid%5D=58236d0b501ae"></iframe>'; |
|
212 | + echo '<iframe id="' . $this->trulia_iframe_id($iframe_id) . '" class="' . $this->trulia_iframe_class('affordability-calc') . '" src="https://synd.trulia.com/tools/affordability-calculator/embedded?params%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Btitle%5D=Affordability+Calculator¶ms%5Bwidth%5D=600¶ms%5Bheight%5D=300¶ms%5Bguid%5D=58236d0b501ae"></iframe>'; |
|
213 | 213 | |
214 | 214 | } |
215 | 215 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | */ |
10 | 10 | |
11 | 11 | /* // Exit if accessed directly */ |
12 | -if ( ! defined( 'ABSPATH' ) ) { exit; } |
|
12 | +if ( ! defined('ABSPATH')) { exit; } |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * The trulia_badges function. |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | /* Style 1 */ |
24 | 24 | array( |
25 | 25 | 'id' => 'truila-btn-1-green', |
26 | - 'name' => __( 'Trulia Button - Green (96x40)', 're-pro' ), |
|
27 | - 'alt' => __( 'Trulia', 're-pro' ), |
|
28 | - 'title' => __( 'Trulia', 're-pro' ), |
|
26 | + 'name' => __('Trulia Button - Green (96x40)', 're-pro'), |
|
27 | + 'alt' => __('Trulia', 're-pro'), |
|
28 | + 'title' => __('Trulia', 're-pro'), |
|
29 | 29 | 'class' => 'trulia-badge', |
30 | 30 | 'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v01_green.gif', |
31 | 31 | 'width' => 96, |
@@ -33,9 +33,9 @@ discard block |
||
33 | 33 | ), |
34 | 34 | array( |
35 | 35 | 'id' => 'truila-btn-1-white', |
36 | - 'name' => __( 'Trulia Button - White (96x40)', 're-pro' ), |
|
37 | - 'alt' => __( 'Trulia', 're-pro' ), |
|
38 | - 'title' => __( 'Trulia', 're-pro' ), |
|
36 | + 'name' => __('Trulia Button - White (96x40)', 're-pro'), |
|
37 | + 'alt' => __('Trulia', 're-pro'), |
|
38 | + 'title' => __('Trulia', 're-pro'), |
|
39 | 39 | 'class' => 'trulia-badge', |
40 | 40 | 'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v01_white.gif', |
41 | 41 | 'width' => 96, |
@@ -43,9 +43,9 @@ discard block |
||
43 | 43 | ), |
44 | 44 | array( |
45 | 45 | 'id' => 'truila-btn-1-white-green', |
46 | - 'name' => __( 'Trulia Button - White/Green (96x40)', 're-pro' ), |
|
47 | - 'alt' => __( 'Trulia', 're-pro' ), |
|
48 | - 'title' => __( 'Trulia', 're-pro' ), |
|
46 | + 'name' => __('Trulia Button - White/Green (96x40)', 're-pro'), |
|
47 | + 'alt' => __('Trulia', 're-pro'), |
|
48 | + 'title' => __('Trulia', 're-pro'), |
|
49 | 49 | 'class' => 'trulia-badge', |
50 | 50 | 'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v01_white_green.gif', |
51 | 51 | 'width' => 96, |
@@ -54,9 +54,9 @@ discard block |
||
54 | 54 | /* Style 2 */ |
55 | 55 | array( |
56 | 56 | 'id' => 'truila-btn-2-green', |
57 | - 'name' => __( 'Trulia Button 2 - Green (87x33)', 're-pro' ), |
|
58 | - 'alt' => __( 'Trulia', 're-pro' ), |
|
59 | - 'title' => __( 'Trulia', 're-pro' ), |
|
57 | + 'name' => __('Trulia Button 2 - Green (87x33)', 're-pro'), |
|
58 | + 'alt' => __('Trulia', 're-pro'), |
|
59 | + 'title' => __('Trulia', 're-pro'), |
|
60 | 60 | 'class' => 'trulia-badge', |
61 | 61 | 'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v02_green.gif', |
62 | 62 | 'width' => 87, |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | ), |
65 | 65 | array( |
66 | 66 | 'id' => 'truila-btn-2-white', |
67 | - 'name' => __( 'Trulia Button 2 - White (87x33)', 're-pro' ), |
|
68 | - 'alt' => __( 'Trulia', 're-pro' ), |
|
69 | - 'title' => __( 'Trulia', 're-pro' ), |
|
67 | + 'name' => __('Trulia Button 2 - White (87x33)', 're-pro'), |
|
68 | + 'alt' => __('Trulia', 're-pro'), |
|
69 | + 'title' => __('Trulia', 're-pro'), |
|
70 | 70 | 'class' => 'trulia-badge', |
71 | 71 | 'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v02_white.gif', |
72 | 72 | 'width' => 87, |
@@ -74,9 +74,9 @@ discard block |
||
74 | 74 | ), |
75 | 75 | array( |
76 | 76 | 'id' => 'truila-btn-2-white-green', |
77 | - 'name' => __( 'Trulia Button 2 - White/Green (87x33)', 're-pro' ), |
|
78 | - 'alt' => __( 'Trulia', 're-pro' ), |
|
79 | - 'title' => __( 'Trulia', 're-pro' ), |
|
77 | + 'name' => __('Trulia Button 2 - White/Green (87x33)', 're-pro'), |
|
78 | + 'alt' => __('Trulia', 're-pro'), |
|
79 | + 'title' => __('Trulia', 're-pro'), |
|
80 | 80 | 'class' => 'trulia-badge', |
81 | 81 | 'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v02_white_green.gif', |
82 | 82 | 'width' => 87, |
@@ -85,9 +85,9 @@ discard block |
||
85 | 85 | /* Style 3 */ |
86 | 86 | array( |
87 | 87 | 'id' => 'truila-btn-3-green', |
88 | - 'name' => __( 'Trulia Button 3 - Green (120x54)', 're-pro' ), |
|
89 | - 'alt' => __( 'Trulia', 're-pro' ), |
|
90 | - 'title' => __( 'Trulia', 're-pro' ), |
|
88 | + 'name' => __('Trulia Button 3 - Green (120x54)', 're-pro'), |
|
89 | + 'alt' => __('Trulia', 're-pro'), |
|
90 | + 'title' => __('Trulia', 're-pro'), |
|
91 | 91 | 'class' => 'trulia-badge', |
92 | 92 | 'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v03_green.gif', |
93 | 93 | 'width' => 120, |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | ), |
96 | 96 | array( |
97 | 97 | 'id' => 'truila-btn-3-white', |
98 | - 'name' => __( 'Trulia Button 3 - White (120x54)', 're-pro' ), |
|
99 | - 'alt' => __( 'Trulia', 're-pro' ), |
|
100 | - 'title' => __( 'Trulia', 're-pro' ), |
|
98 | + 'name' => __('Trulia Button 3 - White (120x54)', 're-pro'), |
|
99 | + 'alt' => __('Trulia', 're-pro'), |
|
100 | + 'title' => __('Trulia', 're-pro'), |
|
101 | 101 | 'class' => 'trulia-badge', |
102 | 102 | 'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v03_white.gif', |
103 | 103 | 'width' => 120, |
@@ -105,9 +105,9 @@ discard block |
||
105 | 105 | ), |
106 | 106 | array( |
107 | 107 | 'id' => 'truila-btn-3-white-green', |
108 | - 'name' => __( 'Trulia Button 3 - White/Green (120x54)', 're-pro' ), |
|
109 | - 'alt' => __( 'Trulia', 're-pro' ), |
|
110 | - 'title' => __( 'Trulia', 're-pro' ), |
|
108 | + 'name' => __('Trulia Button 3 - White/Green (120x54)', 're-pro'), |
|
109 | + 'alt' => __('Trulia', 're-pro'), |
|
110 | + 'title' => __('Trulia', 're-pro'), |
|
111 | 111 | 'class' => 'trulia-badge', |
112 | 112 | 'url' => 'https://static.trulia-cdn.com/images/buttons/trulia_button_v03_white_green.gif', |
113 | 113 | 'width' => 120, |
@@ -16,9 +16,9 @@ |
||
16 | 16 | * @param string $max_sqft (default: '') |
17 | 17 | * @return void |
18 | 18 | */ |
19 | -function get_trulia_rss_listing_feed( $type = 'for_sale', $city, $state, $min_price = '', $max_price = '', $property_type = '', $min_bath = '', $max_bath = '', $min_sqft = '', $max_sqft = '' ) { |
|
19 | +function get_trulia_rss_listing_feed($type = 'for_sale', $city, $state, $min_price = '', $max_price = '', $property_type = '', $min_bath = '', $max_bath = '', $min_sqft = '', $max_sqft = '') { |
|
20 | 20 | |
21 | - $url = esc_url( 'https://www.trulia.com/rss2/'. urlencode($type ).'/'. urlencode( $city ).','. urlencode( $state ).'/' ); |
|
21 | + $url = esc_url('https://www.trulia.com/rss2/' . urlencode($type) . '/' . urlencode($city) . ',' . urlencode($state) . '/'); |
|
22 | 22 | |
23 | 23 | return $url; |
24 | 24 |
@@ -20,9 +20,9 @@ discard block |
||
20 | 20 | |
21 | 21 | parent::__construct( |
22 | 22 | 'realtor_logo', |
23 | - __( 'Realtor Logo', 're-pro' ), |
|
23 | + __('Realtor Logo', 're-pro'), |
|
24 | 24 | array( |
25 | - 'description' => __( 'Display the Realtor Logo.', 're-pro' ), |
|
25 | + 'description' => __('Display the Realtor Logo.', 're-pro'), |
|
26 | 26 | 'classname' => 're-pro realtor', |
27 | 27 | ) |
28 | 28 | ); |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | * @param mixed $instance |
39 | 39 | * @return void |
40 | 40 | */ |
41 | - public function widget( $args, $instance ) { |
|
41 | + public function widget($args, $instance) { |
|
42 | 42 | |
43 | - if ( ! empty( $instance['title'] ) ) { |
|
43 | + if ( ! empty($instance['title'])) { |
|
44 | 44 | $title = $instance['title']; |
45 | 45 | } else { |
46 | 46 | $title = ''; |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | |
50 | 50 | echo $args['before_widget']; |
51 | 51 | |
52 | - echo $args['before_title'] . esc_attr( $title ) . $args['after_title']; |
|
52 | + echo $args['before_title'] . esc_attr($title) . $args['after_title']; |
|
53 | 53 | |
54 | - echo '<img src="'. esc_url( plugins_url( '../../assets/images/realtor/realtor.svg', __FILE__ ) ) .'" alt="'. __( 'Realtor', 're-pro' ) .'" height="' . $logo_size . '" width="' . $logo_size . '" class="re-pro realtor">'; |
|
54 | + echo '<img src="' . esc_url(plugins_url('../../assets/images/realtor/realtor.svg', __FILE__)) . '" alt="' . __('Realtor', 're-pro') . '" height="' . $logo_size . '" width="' . $logo_size . '" class="re-pro realtor">'; |
|
55 | 55 | |
56 | 56 | echo $args['after_widget']; |
57 | 57 | |
@@ -65,38 +65,38 @@ discard block |
||
65 | 65 | * @param mixed $instance |
66 | 66 | * @return void |
67 | 67 | */ |
68 | - public function form( $instance ) { |
|
68 | + public function form($instance) { |
|
69 | 69 | |
70 | 70 | // Set default values |
71 | - $instance = wp_parse_args( (array) $instance, array( |
|
71 | + $instance = wp_parse_args((array) $instance, array( |
|
72 | 72 | 'logo-size' => '32', |
73 | 73 | 'title' => '', |
74 | - ) ); |
|
74 | + )); |
|
75 | 75 | |
76 | 76 | // Retrieve an existing value from the database |
77 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
78 | - $logo_size = ! empty( $instance['logo_size'] ) ? $instance['logo_size'] : ''; |
|
77 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
78 | + $logo_size = ! empty($instance['logo_size']) ? $instance['logo_size'] : ''; |
|
79 | 79 | |
80 | 80 | // Form fields |
81 | 81 | echo '<p>'; |
82 | - echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile', 're-pro' ) . '</label>'; |
|
83 | - echo ' <input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title . '" class="widefat">'; |
|
82 | + echo ' <label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile', 're-pro') . '</label>'; |
|
83 | + echo ' <input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">'; |
|
84 | 84 | echo '</p>'; |
85 | 85 | |
86 | 86 | echo '<p>'; |
87 | - echo ' <label for="' . $this->get_field_id( 'logo_size' ) . '" class="logo-size-label">' . __( 'Logo Size', 're-pro' ) . '</label>'; |
|
88 | - echo ' <select id="' . $this->get_field_id( 'logo_size' ) . '" name="' . $this->get_field_name( 'logo_size' ) . '" class="widefat">'; |
|
89 | - echo ' <option value="" ' . selected( $logo_size, '', false ) . '> ' . __( 'Choose', 're-pro' ) . '</option>'; |
|
90 | - echo ' <option value="512" ' . selected( $logo_size, '512', false ) . '> ' . __( '512px', 're-pro' ) . '</option>'; |
|
91 | - echo ' <option value="256" ' . selected( $logo_size, '256', false ) . '> ' . __( '256px', 're-pro' ) . '</option>'; |
|
92 | - echo ' <option value="128" ' . selected( $logo_size, '128', false ) . '> ' . __( '128px', 're-pro' ) . '</option>'; |
|
93 | - echo ' <option value="64" ' . selected( $logo_size, '64', false ) . '> ' . __( '64px', 're-pro' ) . '</option>'; |
|
94 | - echo ' <option value="32" ' . selected( $logo_size, '32', false ) . '> ' . __( '32px', 're-pro' ) . '</option>'; |
|
95 | - echo ' <option value="24" ' . selected( $logo_size, '24', false ) . '> ' . __( '24px', 're-pro' ) . '</option>'; |
|
96 | - echo ' <option value="16" ' . selected( $logo_size, '16', false ) . '> ' . __( '16px', 're-pro' ) . '</option>'; |
|
97 | - echo ' <option value="14" ' . selected( $logo_size, '14', false ) . '> ' . __( '14px', 're-pro' ) . '</option>'; |
|
87 | + echo ' <label for="' . $this->get_field_id('logo_size') . '" class="logo-size-label">' . __('Logo Size', 're-pro') . '</label>'; |
|
88 | + echo ' <select id="' . $this->get_field_id('logo_size') . '" name="' . $this->get_field_name('logo_size') . '" class="widefat">'; |
|
89 | + echo ' <option value="" ' . selected($logo_size, '', false) . '> ' . __('Choose', 're-pro') . '</option>'; |
|
90 | + echo ' <option value="512" ' . selected($logo_size, '512', false) . '> ' . __('512px', 're-pro') . '</option>'; |
|
91 | + echo ' <option value="256" ' . selected($logo_size, '256', false) . '> ' . __('256px', 're-pro') . '</option>'; |
|
92 | + echo ' <option value="128" ' . selected($logo_size, '128', false) . '> ' . __('128px', 're-pro') . '</option>'; |
|
93 | + echo ' <option value="64" ' . selected($logo_size, '64', false) . '> ' . __('64px', 're-pro') . '</option>'; |
|
94 | + echo ' <option value="32" ' . selected($logo_size, '32', false) . '> ' . __('32px', 're-pro') . '</option>'; |
|
95 | + echo ' <option value="24" ' . selected($logo_size, '24', false) . '> ' . __('24px', 're-pro') . '</option>'; |
|
96 | + echo ' <option value="16" ' . selected($logo_size, '16', false) . '> ' . __('16px', 're-pro') . '</option>'; |
|
97 | + echo ' <option value="14" ' . selected($logo_size, '14', false) . '> ' . __('14px', 're-pro') . '</option>'; |
|
98 | 98 | echo ' </select>'; |
99 | - echo ' <span class="description">' . __( 'Choose the size of the logo you want to display.', 're-pro' ) . '</span>'; |
|
99 | + echo ' <span class="description">' . __('Choose the size of the logo you want to display.', 're-pro') . '</span>'; |
|
100 | 100 | echo '</p>'; |
101 | 101 | |
102 | 102 | } |
@@ -110,12 +110,12 @@ discard block |
||
110 | 110 | * @param mixed $old_instance |
111 | 111 | * @return void |
112 | 112 | */ |
113 | - public function update( $new_instance, $old_instance ) { |
|
113 | + public function update($new_instance, $old_instance) { |
|
114 | 114 | |
115 | 115 | $instance = $old_instance; |
116 | 116 | |
117 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
118 | - $instance['logo_size'] = ! empty( $new_instance['logo_size'] ) ? strip_tags( $new_instance['logo_size'] ) : ''; |
|
117 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
118 | + $instance['logo_size'] = ! empty($new_instance['logo_size']) ? strip_tags($new_instance['logo_size']) : ''; |
|
119 | 119 | |
120 | 120 | return $instance; |
121 | 121 | |
@@ -130,6 +130,6 @@ discard block |
||
130 | 130 | * @return void |
131 | 131 | */ |
132 | 132 | function repro_register_realtorlogo_widget() { |
133 | - register_widget( 'RealtorLogoWidget' ); |
|
133 | + register_widget('RealtorLogoWidget'); |
|
134 | 134 | } |
135 | -add_action( 'widgets_init', 'repro_register_realtorlogo_widget' ); |
|
135 | +add_action('widgets_init', 'repro_register_realtorlogo_widget'); |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /* Exit if accessed directly. */ |
4 | -if ( ! defined( 'ABSPATH' ) ) { exit; } |
|
4 | +if ( ! defined('ABSPATH')) { exit; } |
|
5 | 5 | |
6 | -if ( ! class_exists( 'NarWidgets' ) ) { |
|
6 | +if ( ! class_exists('NarWidgets')) { |
|
7 | 7 | |
8 | 8 | /** |
9 | 9 | * NarWidgets class. |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | * @param string $iframe_id (default: '') |
28 | 28 | * @return void |
29 | 29 | */ |
30 | - public function nar_iframe_id( $iframe_id = '' ) { |
|
30 | + public function nar_iframe_id($iframe_id = '') { |
|
31 | 31 | |
32 | - if ( '' !== $iframe_id ) { |
|
33 | - return sanitize_html_class( $iframe_id ) . '-iframe'; |
|
32 | + if ('' !== $iframe_id) { |
|
33 | + return sanitize_html_class($iframe_id) . '-iframe'; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | } |
@@ -42,10 +42,10 @@ discard block |
||
42 | 42 | * @param string $widget_name (default: '') |
43 | 43 | * @return void |
44 | 44 | */ |
45 | - public function nar_iframe_class( $widget_name = '' ) { |
|
45 | + public function nar_iframe_class($widget_name = '') { |
|
46 | 46 | |
47 | - if ( '' !== $widget_name ) { |
|
48 | - return 'nar nar-iframe nar-' . sanitize_html_class( $widget_name ) . '-iframe'; |
|
47 | + if ('' !== $widget_name) { |
|
48 | + return 'nar nar-iframe nar-' . sanitize_html_class($widget_name) . '-iframe'; |
|
49 | 49 | } else { |
50 | 50 | return 'nar nar-iframe'; |
51 | 51 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function get_mvp_program_widget() { |
62 | 62 | |
63 | - echo '<iframe frameborder="0" id="'. nar_iframe_id() .'" class="'. $this->zillow_iframe_class( 'mvp-program' ) .'" title="'. __('NAR MVP Program.', 're-pro') .'" src="https://static.realtor.org/ro/widget/mvpwidget.html" scrolling="no" width="300" height="250"></iframe>'; |
|
63 | + echo '<iframe frameborder="0" id="' . nar_iframe_id() . '" class="' . $this->zillow_iframe_class('mvp-program') . '" title="' . __('NAR MVP Program.', 're-pro') . '" src="https://static.realtor.org/ro/widget/mvpwidget.html" scrolling="no" width="300" height="250"></iframe>'; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | // wp_enqueue_script( 'nar-message', 'http://www.realtor.org/sites/all/themes/rotheme/js/narmessage.js', 'jquery', null, true); |
75 | 75 | |
76 | - echo '<iframe id="'. nar_iframe_id() .' class="'. $this->zillow_iframe_class( 'home-ownership-matters' ) .'" title="'. __('NAR Home Hownership Matters.', 're-pro') .'" src="https://www.realtor.org/sites/all/themes/rotheme/html/narmessage.html" frameborder="0" width="180" height="250" scrolling="no"></iframe></noscript>'; |
|
76 | + echo '<iframe id="' . nar_iframe_id() . ' class="' . $this->zillow_iframe_class('home-ownership-matters') . '" title="' . __('NAR Home Hownership Matters.', 're-pro') . '" src="https://www.realtor.org/sites/all/themes/rotheme/html/narmessage.html" frameborder="0" width="180" height="250" scrolling="no"></iframe></noscript>'; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * @return void |
84 | 84 | */ |
85 | 85 | public function get_code_of_ethics_widget() { |
86 | - echo '<iframe id="'. nar_iframe_id() .' class="'. $this->zillow_iframe_class( 'code-of-ethics' ) .'" title="'. __('NAR Code of Ethics.', 're-pro') .'" frameborder="0" width="300" height="250" src="https://www.realtor.org/node/7504/embed" scrolling="no"></iframe>'; |
|
86 | + echo '<iframe id="' . nar_iframe_id() . ' class="' . $this->zillow_iframe_class('code-of-ethics') . '" title="' . __('NAR Code of Ethics.', 're-pro') . '" frameborder="0" width="300" height="250" src="https://www.realtor.org/node/7504/embed" scrolling="no"></iframe>'; |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @return void |
94 | 94 | */ |
95 | 95 | public function get_nar_conf_expo_widget() { |
96 | - echo '<iframe id="'. nar_iframe_id() .' class="'. $this->zillow_iframe_class( 'conference-expo' ) .'" title="'. __('NAR Conferences and Expos.', 're-pro') .'" frameborder="0" width="300" height="250" src="https://www.realtor.org/node/10695/embed" scrolling="no"></iframe>'; |
|
96 | + echo '<iframe id="' . nar_iframe_id() . ' class="' . $this->zillow_iframe_class('conference-expo') . '" title="' . __('NAR Conferences and Expos.', 're-pro') . '" frameborder="0" width="300" height="250" src="https://www.realtor.org/node/10695/embed" scrolling="no"></iframe>'; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | } |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /* Exit if accessed directly. */ |
4 | -if ( ! defined( 'ABSPATH' ) ) { exit; } |
|
4 | +if ( ! defined('ABSPATH')) { exit; } |
|
5 | 5 | |
6 | 6 | |
7 | 7 | /** |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | */ |
14 | 14 | function get_zillow_mandatory_disclaimer() { |
15 | 15 | echo '<p class="zillow-disclaimer">'; |
16 | - echo '<span>' . __( '© Zillow, Inc., 2006-', 're-pro') . date("Y") .'. Use is subject to <a href="https://www.zillow.com/corp/Terms.htm" title="'. __( 'Terms of Use', 're-pro') .'" target="_blank" rel="nofollow">'. __( 'Terms of Use', 're-pro') .'</a>.</span><br /> |
|
17 | -<span><a href="https://www.zillow.com/wikipages/What-is-a-Zestimate/" title="'. __( 'What\'s a Zestimate?', 're-pro') .'" target="_blank" rel="nofollow">'. __( 'What\'s a Zestimate?', 're-pro') .'</a></span>'; |
|
16 | + echo '<span>' . __('© Zillow, Inc., 2006-', 're-pro') . date("Y") . '. Use is subject to <a href="https://www.zillow.com/corp/Terms.htm" title="' . __('Terms of Use', 're-pro') . '" target="_blank" rel="nofollow">' . __('Terms of Use', 're-pro') . '</a>.</span><br /> |
|
17 | +<span><a href="https://www.zillow.com/wikipages/What-is-a-Zestimate/" title="'. __('What\'s a Zestimate?', 're-pro') . '" target="_blank" rel="nofollow">' . __('What\'s a Zestimate?', 're-pro') . '</a></span>'; |
|
18 | 18 | echo '</p>'; |
19 | 19 | } |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /* Exit if accessed directly. */ |
4 | -if ( ! defined( 'ABSPATH' ) ) { exit; } |
|
4 | +if ( ! defined('ABSPATH')) { exit; } |
|
5 | 5 | |
6 | 6 | /** |
7 | 7 | * Zillow Mortgage Calculator Widget (https://www.zillow.com/webtools/widgets/MortgageCalculatorWidget.htm) |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | |
27 | 27 | parent::__construct( |
28 | 28 | 'zillow_mortgage_calc_widget', |
29 | - __( 'Zillow Mortgage Calculator', 're-pro' ), |
|
29 | + __('Zillow Mortgage Calculator', 're-pro'), |
|
30 | 30 | array( |
31 | - 'description' => __( 'Display Mortgage Calculator from Zillow.', 're-pro' ), |
|
31 | + 'description' => __('Display Mortgage Calculator from Zillow.', 're-pro'), |
|
32 | 32 | 'classname' => 're-pro re-pro-widget zillow-widget zillow-widget-mortgage-calculator', |
33 | 33 | 'customize_selective_refresh' => true, |
34 | 34 | ) |
@@ -43,13 +43,13 @@ discard block |
||
43 | 43 | * @param mixed $instance Instance. |
44 | 44 | * @return void |
45 | 45 | */ |
46 | - public function widget( $args, $instance ) { |
|
46 | + public function widget($args, $instance) { |
|
47 | 47 | |
48 | - $iframe_id = ! empty( $args['widget_id'] ) ? $args['widget_id'] : ''; |
|
49 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
50 | - $orientation = ! empty( $instance['orientation'] ) ? $instance['orientation'] : ''; |
|
48 | + $iframe_id = ! empty($args['widget_id']) ? $args['widget_id'] : ''; |
|
49 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
50 | + $orientation = ! empty($instance['orientation']) ? $instance['orientation'] : ''; |
|
51 | 51 | |
52 | - if ( 'verticalWidget' === $orientation ) { |
|
52 | + if ('verticalWidget' === $orientation) { |
|
53 | 53 | $height = '470'; |
54 | 54 | $width = '200'; |
55 | 55 | } else { |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | |
60 | 60 | echo $args['before_widget']; |
61 | 61 | |
62 | - echo $args['before_title'] . esc_attr( $title ) . $args['after_title']; |
|
62 | + echo $args['before_title'] . esc_attr($title) . $args['after_title']; |
|
63 | 63 | |
64 | 64 | $zillow_widgets = new ZillowWidgets(); |
65 | 65 | |
66 | - return $zillow_widgets->get_mortgage_calc_widget( $iframe_id, $orientation ); |
|
66 | + return $zillow_widgets->get_mortgage_calc_widget($iframe_id, $orientation); |
|
67 | 67 | |
68 | 68 | |
69 | 69 | echo $args['after_widget']; |
@@ -76,30 +76,30 @@ discard block |
||
76 | 76 | * @param mixed $instance Instance. |
77 | 77 | * @return void |
78 | 78 | */ |
79 | - public function form( $instance ) { |
|
79 | + public function form($instance) { |
|
80 | 80 | |
81 | 81 | // Set default values. |
82 | - $instance = wp_parse_args( (array) $instance, array( |
|
82 | + $instance = wp_parse_args((array) $instance, array( |
|
83 | 83 | 'title' => '', |
84 | 84 | 'orientation' => 'verticalWidget', |
85 | 85 | )); |
86 | 86 | |
87 | 87 | // Retrieve an existing value from the database. |
88 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
89 | - $orientation = ! empty( $instance['orientation'] ) ? $instance['orientation'] : ''; |
|
88 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
89 | + $orientation = ! empty($instance['orientation']) ? $instance['orientation'] : ''; |
|
90 | 90 | |
91 | 91 | // Title. |
92 | 92 | echo '<p>'; |
93 | - echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>'; |
|
94 | - echo ' <input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title . '" class="widefat">'; |
|
93 | + echo ' <label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>'; |
|
94 | + echo ' <input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">'; |
|
95 | 95 | echo '</p>'; |
96 | 96 | |
97 | 97 | // Orientation. |
98 | 98 | echo '<p>'; |
99 | - echo ' <label for="' . $this->get_field_id( 'orientation' ) . '" class="title-label">' . __( 'Orientation:', 're-pro' ) . '</label>'; |
|
100 | - echo '<select id="' . $this->get_field_id( 'orientation' ) . '" name="' . $this->get_field_name( 'orientation' ) . '" class="widefat">'; |
|
101 | - echo '<option value="verticalWidget"'. selected( $orientation, 'verticalWidget' ) .'>'. __( 'Vertical', 're-pro' ) .'</option>'; |
|
102 | - echo '<option value="horizontalWidget"'. selected( $orientation, 'horizontalWidget' ) .'>'. __( 'Horizontal', 're-pro' ) .'</option>'; |
|
99 | + echo ' <label for="' . $this->get_field_id('orientation') . '" class="title-label">' . __('Orientation:', 're-pro') . '</label>'; |
|
100 | + echo '<select id="' . $this->get_field_id('orientation') . '" name="' . $this->get_field_name('orientation') . '" class="widefat">'; |
|
101 | + echo '<option value="verticalWidget"' . selected($orientation, 'verticalWidget') . '>' . __('Vertical', 're-pro') . '</option>'; |
|
102 | + echo '<option value="horizontalWidget"' . selected($orientation, 'horizontalWidget') . '>' . __('Horizontal', 're-pro') . '</option>'; |
|
103 | 103 | echo '</select>'; |
104 | 104 | echo '</p>'; |
105 | 105 | |
@@ -113,12 +113,12 @@ discard block |
||
113 | 113 | * @param mixed $old_instance Old Instance. |
114 | 114 | * @return $instance |
115 | 115 | */ |
116 | - public function update( $new_instance, $old_instance ) { |
|
116 | + public function update($new_instance, $old_instance) { |
|
117 | 117 | |
118 | 118 | $instance = $old_instance; |
119 | 119 | |
120 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
121 | - $instance['orientation'] = ! empty( $new_instance['orientation'] ) ? strip_tags( $new_instance['orientation'] ) : ''; |
|
120 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
121 | + $instance['orientation'] = ! empty($new_instance['orientation']) ? strip_tags($new_instance['orientation']) : ''; |
|
122 | 122 | |
123 | 123 | return $instance; |
124 | 124 | } |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /* Exit if accessed directly. */ |
4 | -if ( ! defined( 'ABSPATH' ) ) { exit; } |
|
4 | +if ( ! defined('ABSPATH')) { exit; } |
|
5 | 5 | |
6 | 6 | /** |
7 | 7 | * Zillow Affordability Calculator Widget (https://www.zillow.com/webtools/widgets/AffordabilityCalculatorWidget.htm) |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | |
28 | 28 | parent::__construct( |
29 | 29 | 'zillow_affordability_calc_widget', |
30 | - __( 'Zillow Affordability Calculator', 're-pro' ), |
|
30 | + __('Zillow Affordability Calculator', 're-pro'), |
|
31 | 31 | array( |
32 | - 'description' => __( 'Display an Affordability Calculator from Zillow.', 're-pro' ), |
|
32 | + 'description' => __('Display an Affordability Calculator from Zillow.', 're-pro'), |
|
33 | 33 | 'classname' => 're-pro re-pro-widget zillow-widget zillow-widget-affordability-calculator', |
34 | 34 | 'customize_selective_refresh' => true, |
35 | 35 | ) |
@@ -44,18 +44,18 @@ discard block |
||
44 | 44 | * @param mixed $instance Instance. |
45 | 45 | * @return void |
46 | 46 | */ |
47 | - public function widget( $args, $instance ) { |
|
47 | + public function widget($args, $instance) { |
|
48 | 48 | |
49 | - $iframe_id = ! empty( $args['widget_id'] ) ? $args['widget_id'] : ''; |
|
50 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
49 | + $iframe_id = ! empty($args['widget_id']) ? $args['widget_id'] : ''; |
|
50 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
51 | 51 | |
52 | 52 | echo $args['before_widget']; |
53 | 53 | |
54 | - echo $args['before_title'] . esc_attr( $title ) . $args['after_title']; |
|
54 | + echo $args['before_title'] . esc_attr($title) . $args['after_title']; |
|
55 | 55 | |
56 | 56 | $zillow_widgets = new ZillowWidgets(); |
57 | 57 | |
58 | - return $zillow_widgets->get_affordability_calc_widget( $iframe_id ); |
|
58 | + return $zillow_widgets->get_affordability_calc_widget($iframe_id); |
|
59 | 59 | |
60 | 60 | |
61 | 61 | echo $args['after_widget']; |
@@ -68,10 +68,10 @@ discard block |
||
68 | 68 | * @param mixed $instance Instance. |
69 | 69 | * @return void |
70 | 70 | */ |
71 | - public function form( $instance ) { |
|
71 | + public function form($instance) { |
|
72 | 72 | |
73 | 73 | // Set default values. |
74 | - $instance = wp_parse_args( (array) $instance, array( |
|
74 | + $instance = wp_parse_args((array) $instance, array( |
|
75 | 75 | 'title' => '', |
76 | 76 | 'screenname' => '', |
77 | 77 | 'region' => '', |
@@ -80,12 +80,12 @@ discard block |
||
80 | 80 | )); |
81 | 81 | |
82 | 82 | // Retrieve an existing value from the database. |
83 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
83 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
84 | 84 | |
85 | 85 | // Title. |
86 | 86 | echo '<p>'; |
87 | - echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>'; |
|
88 | - echo ' <input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title . '" class="widefat">'; |
|
87 | + echo ' <label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>'; |
|
88 | + echo ' <input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">'; |
|
89 | 89 | echo '</p>'; |
90 | 90 | |
91 | 91 | } |
@@ -98,11 +98,11 @@ discard block |
||
98 | 98 | * @param mixed $old_instance Old Instance. |
99 | 99 | * @return $instance |
100 | 100 | */ |
101 | - public function update( $new_instance, $old_instance ) { |
|
101 | + public function update($new_instance, $old_instance) { |
|
102 | 102 | |
103 | 103 | $instance = $old_instance; |
104 | 104 | |
105 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
105 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
106 | 106 | |
107 | 107 | return $instance; |
108 | 108 | } |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /* Exit if accessed directly. */ |
4 | -if ( ! defined( 'ABSPATH' ) ) { exit; } |
|
4 | +if ( ! defined('ABSPATH')) { exit; } |
|
5 | 5 | |
6 | 6 | /** |
7 | 7 | * Zillow Large Search Box Widget (http://www.zillow.com/webtools/widgets/ZillowLargeSearchBox.htm) |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | |
28 | 28 | parent::__construct( |
29 | 29 | 'zillow_large_search_box', |
30 | - __( 'Zillow Large Search Box', 're-pro' ), |
|
30 | + __('Zillow Large Search Box', 're-pro'), |
|
31 | 31 | array( |
32 | - 'description' => __( 'Display a Large Search Box from Zillow.', 're-pro' ), |
|
32 | + 'description' => __('Display a Large Search Box from Zillow.', 're-pro'), |
|
33 | 33 | 'classname' => 're-pro re-pro-widget zillow-widget zillow-widget-search-box', |
34 | 34 | 'customize_selective_refresh' => true, |
35 | 35 | ) |
@@ -44,24 +44,24 @@ discard block |
||
44 | 44 | * @param mixed $instance Instance. |
45 | 45 | * @return void |
46 | 46 | */ |
47 | - public function widget( $args, $instance ) { |
|
47 | + public function widget($args, $instance) { |
|
48 | 48 | |
49 | - $iframe_id = ! empty( $args['widget_id'] ) ? $args['widget_id'] : ''; |
|
50 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
51 | - $type = ! empty( $instance['type'] ) ? $instance['type'] : ''; |
|
52 | - $screenname = ! empty( $instance['screenname'] ) ? $instance['screenname'] : ''; |
|
53 | - $location = ! empty( $instance['location'] ) ? $instance['location'] : ''; |
|
54 | - $home_val_info = ! empty( $instance['home_val_info'] ) ? $instance['home_val_info'] : ''; |
|
55 | - $home_val_info = ( $home_val_info ) ? 'no' : 'yes'; |
|
49 | + $iframe_id = ! empty($args['widget_id']) ? $args['widget_id'] : ''; |
|
50 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
51 | + $type = ! empty($instance['type']) ? $instance['type'] : ''; |
|
52 | + $screenname = ! empty($instance['screenname']) ? $instance['screenname'] : ''; |
|
53 | + $location = ! empty($instance['location']) ? $instance['location'] : ''; |
|
54 | + $home_val_info = ! empty($instance['home_val_info']) ? $instance['home_val_info'] : ''; |
|
55 | + $home_val_info = ($home_val_info) ? 'no' : 'yes'; |
|
56 | 56 | |
57 | 57 | |
58 | 58 | echo $args['before_widget']; |
59 | 59 | |
60 | - echo $args['before_title'] . esc_attr( $title ) . $args['after_title']; |
|
60 | + echo $args['before_title'] . esc_attr($title) . $args['after_title']; |
|
61 | 61 | |
62 | 62 | $zillow_widgets = new ZillowWidgets(); |
63 | 63 | |
64 | - $zillow_widgets->get_lg_zillow_search_widget( $iframe_id, $screenname, 'iframe', $location, $home_val_info ); |
|
64 | + $zillow_widgets->get_lg_zillow_search_widget($iframe_id, $screenname, 'iframe', $location, $home_val_info); |
|
65 | 65 | |
66 | 66 | echo $args['after_widget']; |
67 | 67 | } |
@@ -73,10 +73,10 @@ discard block |
||
73 | 73 | * @param mixed $instance Instance. |
74 | 74 | * @return void |
75 | 75 | */ |
76 | - public function form( $instance ) { |
|
76 | + public function form($instance) { |
|
77 | 77 | |
78 | 78 | // Set default values. |
79 | - $instance = wp_parse_args( (array) $instance, array( |
|
79 | + $instance = wp_parse_args((array) $instance, array( |
|
80 | 80 | 'title' => '', |
81 | 81 | 'type' => 'iframe', |
82 | 82 | 'screenname' => '', |
@@ -85,34 +85,34 @@ discard block |
||
85 | 85 | )); |
86 | 86 | |
87 | 87 | // Retrieve an existing value from the database. |
88 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
89 | - $screenname = ! empty( $instance['screenname'] ) ? $instance['screenname'] : ''; |
|
90 | - $location = ! empty( $instance['location'] ) ? $instance['location'] : ''; |
|
91 | - $home_val_info = ! empty( $instance['home_val_info'] ) ? $instance['home_val_info'] : 0; |
|
88 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
89 | + $screenname = ! empty($instance['screenname']) ? $instance['screenname'] : ''; |
|
90 | + $location = ! empty($instance['location']) ? $instance['location'] : ''; |
|
91 | + $home_val_info = ! empty($instance['home_val_info']) ? $instance['home_val_info'] : 0; |
|
92 | 92 | |
93 | 93 | |
94 | 94 | // Title. |
95 | 95 | echo '<p>'; |
96 | - echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>'; |
|
97 | - echo ' <input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title . '" class="widefat">'; |
|
96 | + echo ' <label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>'; |
|
97 | + echo ' <input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">'; |
|
98 | 98 | echo '</p>'; |
99 | 99 | |
100 | 100 | // Zillow Screenname. |
101 | 101 | echo '<p>'; |
102 | - echo ' <label for="' . $this->get_field_id( 'screenname' ) . '" class="title-label">' . __( 'Zillow Screenname:', 're-pro' ) . '</label>'; |
|
103 | - echo ' <input id="' . $this->get_field_id( 'screenname' ) . '" name="' . $this->get_field_name( 'screenname' ) . '" value="' . $screenname . '" class="widefat">'; |
|
102 | + echo ' <label for="' . $this->get_field_id('screenname') . '" class="title-label">' . __('Zillow Screenname:', 're-pro') . '</label>'; |
|
103 | + echo ' <input id="' . $this->get_field_id('screenname') . '" name="' . $this->get_field_name('screenname') . '" value="' . $screenname . '" class="widefat">'; |
|
104 | 104 | echo '</p>'; |
105 | 105 | |
106 | 106 | // Location. |
107 | 107 | echo '<p>'; |
108 | - echo ' <label for="' . $this->get_field_id( 'location' ) . '" class="title-label">' . __( 'Location:', 're-pro' ) . '</label>'; |
|
109 | - echo ' <input id="' . $this->get_field_id( 'location' ) . '" placeholder="El Segundo, CA" name="' . $this->get_field_name( 'location' ) . '" value="' . $location . '" class="widefat">'; |
|
108 | + echo ' <label for="' . $this->get_field_id('location') . '" class="title-label">' . __('Location:', 're-pro') . '</label>'; |
|
109 | + echo ' <input id="' . $this->get_field_id('location') . '" placeholder="El Segundo, CA" name="' . $this->get_field_name('location') . '" value="' . $location . '" class="widefat">'; |
|
110 | 110 | echo '</p>'; |
111 | 111 | |
112 | 112 | // Home Value Info |
113 | 113 | echo '<p>'; |
114 | - echo '<input value="1" type="checkbox"' . checked( esc_attr( $home_val_info ), 1, false ) . 'id="' . esc_attr( $this->get_field_id( 'home_val_info' ) ) . '" name="' . esc_attr( $this->get_field_name( 'home_val_info' ) ) . '" />'; |
|
115 | - echo '<label for="' . $this->get_field_id( 'home_val_info' ) . '">Hide home value information</label>'; |
|
114 | + echo '<input value="1" type="checkbox"' . checked(esc_attr($home_val_info), 1, false) . 'id="' . esc_attr($this->get_field_id('home_val_info')) . '" name="' . esc_attr($this->get_field_name('home_val_info')) . '" />'; |
|
115 | + echo '<label for="' . $this->get_field_id('home_val_info') . '">Hide home value information</label>'; |
|
116 | 116 | echo '</p>'; |
117 | 117 | |
118 | 118 | |
@@ -126,14 +126,14 @@ discard block |
||
126 | 126 | * @param mixed $old_instance Old Instance. |
127 | 127 | * @return $instance |
128 | 128 | */ |
129 | - public function update( $new_instance, $old_instance ) { |
|
129 | + public function update($new_instance, $old_instance) { |
|
130 | 130 | |
131 | 131 | $instance = $old_instance; |
132 | 132 | |
133 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
134 | - $instance['screenname'] = ! empty( $new_instance['screenname'] ) ? strip_tags( $new_instance['screenname'] ) : ''; |
|
135 | - $instance['location'] = ! empty( $new_instance['location'] ) ? strip_tags( $new_instance['location'] ) : ''; |
|
136 | - $instance['home_val_info'] = ! empty( $new_instance['home_val_info'] ) ? strip_tags( $new_instance['home_val_info'] ) : 0; |
|
133 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
134 | + $instance['screenname'] = ! empty($new_instance['screenname']) ? strip_tags($new_instance['screenname']) : ''; |
|
135 | + $instance['location'] = ! empty($new_instance['location']) ? strip_tags($new_instance['location']) : ''; |
|
136 | + $instance['home_val_info'] = ! empty($new_instance['home_val_info']) ? strip_tags($new_instance['home_val_info']) : 0; |
|
137 | 137 | |
138 | 138 | |
139 | 139 | return $instance; |
@@ -148,6 +148,6 @@ discard block |
||
148 | 148 | */ |
149 | 149 | function repro_zillow_search_box_widget() { |
150 | 150 | |
151 | - register_widget( 'ZillowLargeSearchBox' ); |
|
151 | + register_widget('ZillowLargeSearchBox'); |
|
152 | 152 | } |
153 | -add_action( 'widgets_init', 'repro_zillow_search_box_widget' ); |
|
153 | +add_action('widgets_init', 'repro_zillow_search_box_widget'); |