@@ -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 Newest For Sale Homes Widget (http://www.zillow.com/webtools/widgets/NewestForSaleHomes.htm) |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | |
28 | 28 | parent::__construct( |
29 | 29 | 'zillow_newest_forsale_homes_widget', |
30 | - __( 'Zillow Newest For Sale Homes', 're-pro' ), |
|
30 | + __('Zillow Newest For Sale Homes', 're-pro'), |
|
31 | 31 | array( |
32 | - 'description' => __( 'Display the most recent for sale homes from Zillow.', 're-pro' ), |
|
32 | + 'description' => __('Display the most recent for sale homes from Zillow.', 're-pro'), |
|
33 | 33 | 'classname' => 're-pro re-pro-widget zillow-widget zillow-widget-newest-homes', |
34 | 34 | 'customize_selective_refresh' => true, |
35 | 35 | ) |
@@ -44,22 +44,22 @@ 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 | - $size = ! empty( $instance['size'] ) ? $instance['size'] : ''; |
|
53 | - $location = ! empty( $instance['location'] ) ? $instance['location'] : ''; |
|
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 | + $size = ! empty($instance['size']) ? $instance['size'] : ''; |
|
53 | + $location = ! empty($instance['location']) ? $instance['location'] : ''; |
|
54 | 54 | |
55 | 55 | echo $args['before_widget']; |
56 | 56 | |
57 | - echo $args['before_title'] . esc_attr( $title ) . $args['after_title']; |
|
57 | + echo $args['before_title'] . esc_attr($title) . $args['after_title']; |
|
58 | 58 | |
59 | 59 | |
60 | 60 | $zillow_widgets = new ZillowWidgets(); |
61 | 61 | |
62 | - $zillow_widgets->get_newest_forsale_homes_widget( $iframe_id, $location, 'iframe', 'wide' ); |
|
62 | + $zillow_widgets->get_newest_forsale_homes_widget($iframe_id, $location, 'iframe', 'wide'); |
|
63 | 63 | |
64 | 64 | |
65 | 65 | echo $args['after_widget']; |
@@ -72,10 +72,10 @@ discard block |
||
72 | 72 | * @param mixed $instance Instance. |
73 | 73 | * @return void |
74 | 74 | */ |
75 | - public function form( $instance ) { |
|
75 | + public function form($instance) { |
|
76 | 76 | |
77 | 77 | // Set default values. |
78 | - $instance = wp_parse_args( (array) $instance, array( |
|
78 | + $instance = wp_parse_args((array) $instance, array( |
|
79 | 79 | 'title' => '', |
80 | 80 | 'type' => 'iframe', |
81 | 81 | 'size' => 'wide', |
@@ -83,19 +83,19 @@ discard block |
||
83 | 83 | )); |
84 | 84 | |
85 | 85 | // Retrieve an existing value from the database. |
86 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
87 | - $location = ! empty( $instance['location'] ) ? $instance['location'] : ''; |
|
86 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
87 | + $location = ! empty($instance['location']) ? $instance['location'] : ''; |
|
88 | 88 | |
89 | 89 | // Title. |
90 | 90 | echo '<p>'; |
91 | - echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>'; |
|
92 | - echo ' <input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title . '" class="widefat">'; |
|
91 | + echo ' <label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>'; |
|
92 | + echo ' <input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">'; |
|
93 | 93 | echo '</p>'; |
94 | 94 | |
95 | 95 | // Location. |
96 | 96 | echo '<p>'; |
97 | - echo ' <label for="' . $this->get_field_id( 'location' ) . '" class="title-label">' . __( 'Location:', 're-pro' ) . '</label>'; |
|
98 | - echo ' <input id="' . $this->get_field_id( 'location' ) . '" placeholder="El Segundo, CA" name="' . $this->get_field_name( 'location' ) . '" value="' . $location . '" class="widefat">'; |
|
97 | + echo ' <label for="' . $this->get_field_id('location') . '" class="title-label">' . __('Location:', 're-pro') . '</label>'; |
|
98 | + echo ' <input id="' . $this->get_field_id('location') . '" placeholder="El Segundo, CA" name="' . $this->get_field_name('location') . '" value="' . $location . '" class="widefat">'; |
|
99 | 99 | echo '</p>'; |
100 | 100 | |
101 | 101 | } |
@@ -108,14 +108,14 @@ discard block |
||
108 | 108 | * @param mixed $old_instance Old Instance. |
109 | 109 | * @return $instance |
110 | 110 | */ |
111 | - public function update( $new_instance, $old_instance ) { |
|
111 | + public function update($new_instance, $old_instance) { |
|
112 | 112 | |
113 | 113 | $instance = $old_instance; |
114 | 114 | |
115 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
116 | - $instance['type'] = ! empty( $new_instance['type'] ) ? strip_tags( $new_instance['type'] ) : ''; |
|
117 | - $instance['size'] = ! empty( $new_instance['size'] ) ? strip_tags( $new_instance['size'] ) : ''; |
|
118 | - $instance['location'] = ! empty( $new_instance['location'] ) ? strip_tags( $new_instance['location'] ) : ''; |
|
115 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
116 | + $instance['type'] = ! empty($new_instance['type']) ? strip_tags($new_instance['type']) : ''; |
|
117 | + $instance['size'] = ! empty($new_instance['size']) ? strip_tags($new_instance['size']) : ''; |
|
118 | + $instance['location'] = ! empty($new_instance['location']) ? strip_tags($new_instance['location']) : ''; |
|
119 | 119 | |
120 | 120 | return $instance; |
121 | 121 | } |
@@ -129,6 +129,6 @@ discard block |
||
129 | 129 | */ |
130 | 130 | function repro_zillow_newest_homes_widget() { |
131 | 131 | |
132 | - register_widget( 'ZillowNewestHomesWidget' ); |
|
132 | + register_widget('ZillowNewestHomesWidget'); |
|
133 | 133 | } |
134 | -add_action( 'widgets_init', 'repro_zillow_newest_homes_widget' ); |
|
134 | +add_action('widgets_init', 'repro_zillow_newest_homes_widget'); |
@@ -287,48 +287,48 @@ |
||
287 | 287 | */ |
288 | 288 | public function response_code_msg( $code = '' ) { |
289 | 289 | switch ( $code ) { |
290 | - case 0: |
|
291 | - $msg = __( 'Request successfully processed.', 're-pro' ); |
|
292 | - break; |
|
293 | - case 1: |
|
294 | - $msg = __( 'Service error-there was a server-side error while processing the request.', 're-pro' ); |
|
295 | - break; |
|
296 | - case 2: |
|
297 | - $msg = __( 'The specified ZWSID parameter was invalid or not specified in the request.', 're-pro' ); |
|
298 | - break; |
|
299 | - case 3: |
|
300 | - $msg = __( 'Web services are currently unavailable.', 're-pro' ); |
|
301 | - break; |
|
302 | - case 4: |
|
303 | - $msg = __( 'The API call is currently unavailable.', 're-pro' ); |
|
304 | - break; |
|
305 | - case 500: |
|
306 | - $msg = __( 'Invalid or missing address parameter.', 're-pro' ); |
|
307 | - break; |
|
308 | - case 501: |
|
309 | - $msg = __( 'Invalid or missing city, state, zip parameter.', 're-pro' ); |
|
310 | - break; |
|
311 | - case 502: |
|
312 | - $msg = __( 'No results found.', 're-pro' ); |
|
313 | - break; |
|
314 | - case 503: |
|
315 | - $msg = __( 'Failed to resolve city, state or ZIP code.', 're-pro' ); |
|
316 | - break; |
|
317 | - case 504: |
|
318 | - $msg = __( 'No coverage for specified area.', 're-pro' ); |
|
319 | - break; |
|
320 | - case 505: |
|
321 | - $msg = __( 'Timeout.', 're-pro' ); |
|
322 | - break; |
|
323 | - case 506: |
|
324 | - $msg = __( 'Address string too long.', 're-pro' ); |
|
325 | - break; |
|
326 | - case 507: |
|
327 | - $msg = __( 'No exact match found.', 're-pro' ); |
|
328 | - break; |
|
329 | - default: |
|
330 | - $msg = __( 'Sorry, response code is unknown.' ); |
|
331 | - break; |
|
290 | + case 0: |
|
291 | + $msg = __( 'Request successfully processed.', 're-pro' ); |
|
292 | + break; |
|
293 | + case 1: |
|
294 | + $msg = __( 'Service error-there was a server-side error while processing the request.', 're-pro' ); |
|
295 | + break; |
|
296 | + case 2: |
|
297 | + $msg = __( 'The specified ZWSID parameter was invalid or not specified in the request.', 're-pro' ); |
|
298 | + break; |
|
299 | + case 3: |
|
300 | + $msg = __( 'Web services are currently unavailable.', 're-pro' ); |
|
301 | + break; |
|
302 | + case 4: |
|
303 | + $msg = __( 'The API call is currently unavailable.', 're-pro' ); |
|
304 | + break; |
|
305 | + case 500: |
|
306 | + $msg = __( 'Invalid or missing address parameter.', 're-pro' ); |
|
307 | + break; |
|
308 | + case 501: |
|
309 | + $msg = __( 'Invalid or missing city, state, zip parameter.', 're-pro' ); |
|
310 | + break; |
|
311 | + case 502: |
|
312 | + $msg = __( 'No results found.', 're-pro' ); |
|
313 | + break; |
|
314 | + case 503: |
|
315 | + $msg = __( 'Failed to resolve city, state or ZIP code.', 're-pro' ); |
|
316 | + break; |
|
317 | + case 504: |
|
318 | + $msg = __( 'No coverage for specified area.', 're-pro' ); |
|
319 | + break; |
|
320 | + case 505: |
|
321 | + $msg = __( 'Timeout.', 're-pro' ); |
|
322 | + break; |
|
323 | + case 506: |
|
324 | + $msg = __( 'Address string too long.', 're-pro' ); |
|
325 | + break; |
|
326 | + case 507: |
|
327 | + $msg = __( 'No exact match found.', 're-pro' ); |
|
328 | + break; |
|
329 | + default: |
|
330 | + $msg = __( 'Sorry, response code is unknown.' ); |
|
331 | + break; |
|
332 | 332 | } |
333 | 333 | return $msg; |
334 | 334 | } |
@@ -15,9 +15,9 @@ discard block |
||
15 | 15 | * GitHub Branch: master |
16 | 16 | */ |
17 | 17 | /* Exit if accessed directly. */ |
18 | -if ( ! defined( 'ABSPATH' ) ) { exit; } |
|
18 | +if ( ! defined('ABSPATH')) { exit; } |
|
19 | 19 | /* Check if class exists. */ |
20 | -if ( ! class_exists( 'ZillowAPI' ) ) { |
|
20 | +if ( ! class_exists('ZillowAPI')) { |
|
21 | 21 | /** |
22 | 22 | * Zillow API Class. |
23 | 23 | */ |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * @param mixed $output Output. |
50 | 50 | * @return void |
51 | 51 | */ |
52 | - public function __construct( $zws_id, $output = 'json' ) { |
|
52 | + public function __construct($zws_id, $output = 'json') { |
|
53 | 53 | static::$zws_id = $zws_id; |
54 | 54 | static::$output = $output; |
55 | 55 | } |
@@ -60,14 +60,14 @@ discard block |
||
60 | 60 | * @param mixed $request Request URL. |
61 | 61 | * @return $body Body. |
62 | 62 | */ |
63 | - private function fetch( $request ) { |
|
64 | - $response = wp_remote_get( $request ); |
|
65 | - $code = wp_remote_retrieve_response_code( $response ); |
|
66 | - if ( 200 !== $code ) { |
|
67 | - return new WP_Error( 'response-error', sprintf( __( 'Server response code: %d', 're-pro' ), $code ) ); |
|
63 | + private function fetch($request) { |
|
64 | + $response = wp_remote_get($request); |
|
65 | + $code = wp_remote_retrieve_response_code($response); |
|
66 | + if (200 !== $code) { |
|
67 | + return new WP_Error('response-error', sprintf(__('Server response code: %d', 're-pro'), $code)); |
|
68 | 68 | } |
69 | - $body = wp_remote_retrieve_body( $response ); |
|
70 | - return json_decode( $body ); |
|
69 | + $body = wp_remote_retrieve_body($response); |
|
70 | + return json_decode($body); |
|
71 | 71 | } |
72 | 72 | /** |
73 | 73 | * Get Zillow Reviews (https://www.zillow.com/howto/api/ReviewsAPI.htm) |
@@ -79,12 +79,12 @@ discard block |
||
79 | 79 | * @param mixed $returnTeamMemberReviews (default: null) Return Team Member Reviews. |
80 | 80 | * @return Request. |
81 | 81 | */ |
82 | - function get_reviews( $screenname, $email = null, $count = '3', $returnTeamMemberReviews = null ) { |
|
83 | - if ( empty( $screenname ) ) { |
|
84 | - return new WP_Error( 'required-fields', __( 'Required fields are empty.', 're-pro' ) ); |
|
82 | + function get_reviews($screenname, $email = null, $count = '3', $returnTeamMemberReviews = null) { |
|
83 | + if (empty($screenname)) { |
|
84 | + return new WP_Error('required-fields', __('Required fields are empty.', 're-pro')); |
|
85 | 85 | } |
86 | 86 | $request = $this->base_uri . '/ProReviews.htm?zws-id=' . static::$zws_id . '&screenname=' . $screenname . '&output=json'; |
87 | - return $this->fetch( $request ); |
|
87 | + return $this->fetch($request); |
|
88 | 88 | } |
89 | 89 | /** |
90 | 90 | * Get Mortage Rate Summary (https://www.zillow.com/howto/api/GetRateSummary.htm) |
@@ -94,9 +94,9 @@ discard block |
||
94 | 94 | * @param string $callback (default: '') Callback. |
95 | 95 | * @return Request. |
96 | 96 | */ |
97 | - function get_rate_summary( $state = null, $callback = '' ) { |
|
97 | + function get_rate_summary($state = null, $callback = '') { |
|
98 | 98 | $request = $this->base_uri . '/GetRateSummary.htm?zws-id=' . static::$zws_id . '&output=json'; |
99 | - return $this->fetch( $request ); |
|
99 | + return $this->fetch($request); |
|
100 | 100 | } |
101 | 101 | /** |
102 | 102 | * Get Monthly Payments (https://www.zillow.com/howto/api/GetMonthlyPayments.htm) |
@@ -110,12 +110,12 @@ discard block |
||
110 | 110 | * @param mixed $callback (default: null) Callback. |
111 | 111 | * @return Request. |
112 | 112 | */ |
113 | - function get_monthly_payments( $price, $down = null, $dollarsdown = null, $zip = null, $output = null, $callback = null ) { |
|
114 | - if ( empty( $price ) ) { |
|
115 | - return new WP_Error( 'required-fields', __( 'Required fields are empty.', 're-pro' ) ); |
|
113 | + function get_monthly_payments($price, $down = null, $dollarsdown = null, $zip = null, $output = null, $callback = null) { |
|
114 | + if (empty($price)) { |
|
115 | + return new WP_Error('required-fields', __('Required fields are empty.', 're-pro')); |
|
116 | 116 | } |
117 | 117 | $request = $this->base_uri . '/GetMonthlyPayments.htm?zws-id=' . static::$zws_id . '&output=json' . '&price=' . $price; |
118 | - return $this->fetch( $request ); |
|
118 | + return $this->fetch($request); |
|
119 | 119 | } |
120 | 120 | /** |
121 | 121 | * Get Deep Search Results. |
@@ -126,14 +126,14 @@ discard block |
||
126 | 126 | * @param mixed $rentzestimate (default: null) Rent Zestimate. |
127 | 127 | * @return Request. |
128 | 128 | */ |
129 | - function get_deep_search_results( $address, $citystatezip, $rentzestimate = null ) { |
|
130 | - if ( empty( $address ) ) { |
|
131 | - return new WP_Error( 'required-fields', __( 'Required fields are empty.', 're-pro' ) ); |
|
129 | + function get_deep_search_results($address, $citystatezip, $rentzestimate = null) { |
|
130 | + if (empty($address)) { |
|
131 | + return new WP_Error('required-fields', __('Required fields are empty.', 're-pro')); |
|
132 | 132 | } |
133 | 133 | $request = $this->base_uri . '/GetMonthlyPayments.htm?zws-id=' . static::$zws_id . '&address=' . $address . '&citystatezip=' . $citystatezip; |
134 | - $xml = simplexml_load_file( $request ); |
|
135 | - $json = wp_json_encode( $xml ); |
|
136 | - $deep_results = json_decode( $json, true ); |
|
134 | + $xml = simplexml_load_file($request); |
|
135 | + $json = wp_json_encode($xml); |
|
136 | + $deep_results = json_decode($json, true); |
|
137 | 137 | return $deep_results; |
138 | 138 | } |
139 | 139 | /** |
@@ -145,14 +145,14 @@ discard block |
||
145 | 145 | * @param bool $rentzestimate (default: false) Rent Zestimate. |
146 | 146 | * @return Request. |
147 | 147 | */ |
148 | - function get_deep_comps( $zpid, $count = '5', $rentzestimate = false ) { |
|
149 | - if ( empty( $zpid ) ) { |
|
150 | - return new WP_Error( 'required-fields', __( 'Required fields are empty.', 're-pro' ) ); |
|
148 | + function get_deep_comps($zpid, $count = '5', $rentzestimate = false) { |
|
149 | + if (empty($zpid)) { |
|
150 | + return new WP_Error('required-fields', __('Required fields are empty.', 're-pro')); |
|
151 | 151 | } |
152 | 152 | $request = $this->base_uri . '/GetDeepComps.htm?zws-id=' . static::$zws_id . '&zpid=' . $zpid . '&count=' . $count; |
153 | - $xml = simplexml_load_file( $request ); |
|
154 | - $json = wp_json_encode( $xml ); |
|
155 | - $deep_comps = json_decode( $json, true ); |
|
153 | + $xml = simplexml_load_file($request); |
|
154 | + $json = wp_json_encode($xml); |
|
155 | + $deep_comps = json_decode($json, true); |
|
156 | 156 | return $deep_comps; |
157 | 157 | } |
158 | 158 | /** |
@@ -162,14 +162,14 @@ discard block |
||
162 | 162 | * @param mixed $zpid ZPID. |
163 | 163 | * @return Request. |
164 | 164 | */ |
165 | - function get_updated_property_details( $zpid ) { |
|
166 | - if ( empty( $zpid ) ) { |
|
167 | - return new WP_Error( 'required-fields', __( 'Required fields are empty.', 're-pro' ) ); |
|
165 | + function get_updated_property_details($zpid) { |
|
166 | + if (empty($zpid)) { |
|
167 | + return new WP_Error('required-fields', __('Required fields are empty.', 're-pro')); |
|
168 | 168 | } |
169 | 169 | $request = $this->base_uri . '/GetUpdatedPropertyDetails.htm?zws-id=' . static::$zws_id . '&zpid=' . $zpid; |
170 | - $xml = simplexml_load_file( $request ); |
|
171 | - $json = wp_json_encode( $xml ); |
|
172 | - $prop_details = json_decode( $json, true ); |
|
170 | + $xml = simplexml_load_file($request); |
|
171 | + $json = wp_json_encode($xml); |
|
172 | + $prop_details = json_decode($json, true); |
|
173 | 173 | return $prop_details; |
174 | 174 | } |
175 | 175 | /** |
@@ -181,14 +181,14 @@ discard block |
||
181 | 181 | * @param bool $rentzestimate (default: false) Rent Zestimate. |
182 | 182 | * @return Request. |
183 | 183 | */ |
184 | - function get_search_results( $address, $citystatezip, $rentzestimate = false ) { |
|
185 | - if ( empty( $address ) && empty( $citystatezip ) ) { |
|
186 | - return new WP_Error( 'required-fields', __( 'Required fields are empty.', 're-pro' ) ); |
|
184 | + function get_search_results($address, $citystatezip, $rentzestimate = false) { |
|
185 | + if (empty($address) && empty($citystatezip)) { |
|
186 | + return new WP_Error('required-fields', __('Required fields are empty.', 're-pro')); |
|
187 | 187 | } |
188 | 188 | $request = $this->base_uri . '/GetUpdatedPropertyDetails.htm?zws-id=' . static::$zws_id . '&address=' . $address . '&citystatezip=' . $citystatezip; |
189 | - $xml = simplexml_load_file( $request ); |
|
190 | - $json = wp_json_encode( $xml ); |
|
191 | - $search_results = json_decode( $json, true ); |
|
189 | + $xml = simplexml_load_file($request); |
|
190 | + $json = wp_json_encode($xml); |
|
191 | + $search_results = json_decode($json, true); |
|
192 | 192 | return $search_results; |
193 | 193 | } |
194 | 194 | /** |
@@ -200,14 +200,14 @@ discard block |
||
200 | 200 | * @param mixed $zpid ZPID. |
201 | 201 | * @return Request. |
202 | 202 | */ |
203 | - function get_zestimate( $zpid ) { |
|
204 | - if ( empty( $zpid ) ) { |
|
205 | - return new WP_Error( 'required-fields', __( 'Required fields are empty.', 're-pro' ) ); |
|
203 | + function get_zestimate($zpid) { |
|
204 | + if (empty($zpid)) { |
|
205 | + return new WP_Error('required-fields', __('Required fields are empty.', 're-pro')); |
|
206 | 206 | } |
207 | 207 | $request = $this->base_uri . '/GetZestimate.htm?zws-id=' . static::$zws_id . '&zpid=' . $zpid; |
208 | - $xml = simplexml_load_file( $request ); |
|
209 | - $json = wp_json_encode( $xml ); |
|
210 | - $zestimate = json_decode( $json, true ); |
|
208 | + $xml = simplexml_load_file($request); |
|
209 | + $json = wp_json_encode($xml); |
|
210 | + $zestimate = json_decode($json, true); |
|
211 | 211 | return $zestimate; |
212 | 212 | } |
213 | 213 | /** |
@@ -221,14 +221,14 @@ discard block |
||
221 | 221 | * @param string $chart_duration (default: '1year') Chart Duration. |
222 | 222 | * @return Request. |
223 | 223 | */ |
224 | - function get_chart( $zpid, $unit_type, $width = '600', $height = '300', $chart_duration = '1year' ) { |
|
225 | - if ( empty( $zpid ) && empty( $unit_type ) ) { |
|
226 | - return new WP_Error( 'required-fields', __( 'Required fields are empty.', 're-pro' ) ); |
|
224 | + function get_chart($zpid, $unit_type, $width = '600', $height = '300', $chart_duration = '1year') { |
|
225 | + if (empty($zpid) && empty($unit_type)) { |
|
226 | + return new WP_Error('required-fields', __('Required fields are empty.', 're-pro')); |
|
227 | 227 | } |
228 | 228 | $request = $this->base_uri . '/GetChart.htm?zws-id=' . static::$zws_id . '&unit-type=' . $unit_type . '&zpid=' . $zpid; |
229 | - $xml = simplexml_load_file( $request ); |
|
230 | - $json = wp_json_encode( $xml ); |
|
231 | - $chart = json_decode( $json, true ); |
|
229 | + $xml = simplexml_load_file($request); |
|
230 | + $json = wp_json_encode($xml); |
|
231 | + $chart = json_decode($json, true); |
|
232 | 232 | return $chart; |
233 | 233 | } |
234 | 234 | /** |
@@ -240,14 +240,14 @@ discard block |
||
240 | 240 | * @param bool $rentzestimate (default: false) Rent Zestimate. |
241 | 241 | * @return Request. |
242 | 242 | */ |
243 | - function get_comps( $zpid, $count, $rentzestimate = false ) { |
|
244 | - if ( empty( $zpid ) && empty( $count ) ) { |
|
245 | - return new WP_Error( 'required-fields', __( 'Required fields are empty.', 're-pro' ) ); |
|
243 | + function get_comps($zpid, $count, $rentzestimate = false) { |
|
244 | + if (empty($zpid) && empty($count)) { |
|
245 | + return new WP_Error('required-fields', __('Required fields are empty.', 're-pro')); |
|
246 | 246 | } |
247 | 247 | $request = $this->base_uri . '/GetComps.htm?zws-id=' . static::$zws_id . '&zpid=' . $zpid . '&count=' . $count; |
248 | - $xml = simplexml_load_file( $request ); |
|
249 | - $json = wp_json_encode( $xml ); |
|
250 | - $comps = json_decode( $json, true ); |
|
248 | + $xml = simplexml_load_file($request); |
|
249 | + $json = wp_json_encode($xml); |
|
250 | + $comps = json_decode($json, true); |
|
251 | 251 | return $comps; |
252 | 252 | } |
253 | 253 | /** |
@@ -257,12 +257,12 @@ discard block |
||
257 | 257 | * @param mixed $url URL. |
258 | 258 | * @return Request. |
259 | 259 | */ |
260 | - function get_zpid_from_url( $url ) { |
|
261 | - if ( empty( $url ) ) { |
|
262 | - return new WP_Error( 'required-fields', __( 'Please provide a URL.', 're-pro' ) ); |
|
260 | + function get_zpid_from_url($url) { |
|
261 | + if (empty($url)) { |
|
262 | + return new WP_Error('required-fields', __('Please provide a URL.', 're-pro')); |
|
263 | 263 | } |
264 | - preg_match( '!\d+_zpid!', $url, $matches ); |
|
265 | - $final_match = preg_replace( '/_zpid/', '', $matches ); |
|
264 | + preg_match('!\d+_zpid!', $url, $matches); |
|
265 | + $final_match = preg_replace('/_zpid/', '', $matches); |
|
266 | 266 | return $final_match['0']; |
267 | 267 | } |
268 | 268 | /** |
@@ -272,11 +272,11 @@ discard block |
||
272 | 272 | * @param mixed $url URL. |
273 | 273 | * @return void |
274 | 274 | */ |
275 | - function get_agent_screenname_from_url( $url ) { |
|
276 | - if ( empty( $url ) ) { |
|
277 | - return new WP_Error( 'required-fields', __( 'Please provide a URL.', 're-pro' ) ); |
|
275 | + function get_agent_screenname_from_url($url) { |
|
276 | + if (empty($url)) { |
|
277 | + return new WP_Error('required-fields', __('Please provide a URL.', 're-pro')); |
|
278 | 278 | } |
279 | - $final_match = preg_replace( '/\/(\d+)$/', '', explode('/', $url) ); |
|
279 | + $final_match = preg_replace('/\/(\d+)$/', '', explode('/', $url)); |
|
280 | 280 | return $final_match[4]; |
281 | 281 | } |
282 | 282 | /** |
@@ -285,49 +285,49 @@ discard block |
||
285 | 285 | * @param [String] $code : Response code to get message from. |
286 | 286 | * @return [String] : Message corresponding to response code sent in. |
287 | 287 | */ |
288 | - public function response_code_msg( $code = '' ) { |
|
289 | - switch ( $code ) { |
|
288 | + public function response_code_msg($code = '') { |
|
289 | + switch ($code) { |
|
290 | 290 | case 0: |
291 | - $msg = __( 'Request successfully processed.', 're-pro' ); |
|
291 | + $msg = __('Request successfully processed.', 're-pro'); |
|
292 | 292 | break; |
293 | 293 | case 1: |
294 | - $msg = __( 'Service error-there was a server-side error while processing the request.', 're-pro' ); |
|
294 | + $msg = __('Service error-there was a server-side error while processing the request.', 're-pro'); |
|
295 | 295 | break; |
296 | 296 | case 2: |
297 | - $msg = __( 'The specified ZWSID parameter was invalid or not specified in the request.', 're-pro' ); |
|
297 | + $msg = __('The specified ZWSID parameter was invalid or not specified in the request.', 're-pro'); |
|
298 | 298 | break; |
299 | 299 | case 3: |
300 | - $msg = __( 'Web services are currently unavailable.', 're-pro' ); |
|
300 | + $msg = __('Web services are currently unavailable.', 're-pro'); |
|
301 | 301 | break; |
302 | 302 | case 4: |
303 | - $msg = __( 'The API call is currently unavailable.', 're-pro' ); |
|
303 | + $msg = __('The API call is currently unavailable.', 're-pro'); |
|
304 | 304 | break; |
305 | 305 | case 500: |
306 | - $msg = __( 'Invalid or missing address parameter.', 're-pro' ); |
|
306 | + $msg = __('Invalid or missing address parameter.', 're-pro'); |
|
307 | 307 | break; |
308 | 308 | case 501: |
309 | - $msg = __( 'Invalid or missing city, state, zip parameter.', 're-pro' ); |
|
309 | + $msg = __('Invalid or missing city, state, zip parameter.', 're-pro'); |
|
310 | 310 | break; |
311 | 311 | case 502: |
312 | - $msg = __( 'No results found.', 're-pro' ); |
|
312 | + $msg = __('No results found.', 're-pro'); |
|
313 | 313 | break; |
314 | 314 | case 503: |
315 | - $msg = __( 'Failed to resolve city, state or ZIP code.', 're-pro' ); |
|
315 | + $msg = __('Failed to resolve city, state or ZIP code.', 're-pro'); |
|
316 | 316 | break; |
317 | 317 | case 504: |
318 | - $msg = __( 'No coverage for specified area.', 're-pro' ); |
|
318 | + $msg = __('No coverage for specified area.', 're-pro'); |
|
319 | 319 | break; |
320 | 320 | case 505: |
321 | - $msg = __( 'Timeout.', 're-pro' ); |
|
321 | + $msg = __('Timeout.', 're-pro'); |
|
322 | 322 | break; |
323 | 323 | case 506: |
324 | - $msg = __( 'Address string too long.', 're-pro' ); |
|
324 | + $msg = __('Address string too long.', 're-pro'); |
|
325 | 325 | break; |
326 | 326 | case 507: |
327 | - $msg = __( 'No exact match found.', 're-pro' ); |
|
327 | + $msg = __('No exact match found.', 're-pro'); |
|
328 | 328 | break; |
329 | 329 | default: |
330 | - $msg = __( 'Sorry, response code is unknown.' ); |
|
330 | + $msg = __('Sorry, response code is unknown.'); |
|
331 | 331 | break; |
332 | 332 | } |
333 | 333 | return $msg; |
@@ -40,7 +40,7 @@ |
||
40 | 40 | * Fetch the request from the API. |
41 | 41 | * |
42 | 42 | * @access private |
43 | - * @param mixed $request Request URL. |
|
43 | + * @param string $request Request URL. |
|
44 | 44 | * @return $body Body. |
45 | 45 | */ |
46 | 46 | private function fetch( $request ) { |
@@ -6,12 +6,12 @@ |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | /* Exit if accessed directly. */ |
9 | -if ( ! defined( 'ABSPATH' ) ) { exit; } |
|
9 | +if ( ! defined('ABSPATH')) { exit; } |
|
10 | 10 | |
11 | -include( 'widgets/class-zillow-widgets.php' ); |
|
11 | +include('widgets/class-zillow-widgets.php'); |
|
12 | 12 | |
13 | 13 | // Include Review Widget. |
14 | -include( 'widgets/class-review-widget.php' ); |
|
14 | +include('widgets/class-review-widget.php'); |
|
15 | 15 | |
16 | 16 | // Include Badges Widget |
17 | 17 | include('widgets/class-zillow-badges-widget.php'); |
@@ -6,21 +6,21 @@ |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | /* Exit if accessed directly. */ |
9 | -if ( ! defined( 'ABSPATH' ) ) { exit; } |
|
9 | +if ( ! defined('ABSPATH')) { exit; } |
|
10 | 10 | |
11 | -include( 'widgets/class-homefinder-widgets.php' ); |
|
11 | +include('widgets/class-homefinder-widgets.php'); |
|
12 | 12 | |
13 | 13 | // Homes for Sale Widget. |
14 | -include( 'widgets/class-homes-for-sale-widget.php' ); |
|
14 | +include('widgets/class-homes-for-sale-widget.php'); |
|
15 | 15 | |
16 | 16 | // Open House Widget. |
17 | -include( 'widgets/class-open-house-widget.php' ); |
|
17 | +include('widgets/class-open-house-widget.php'); |
|
18 | 18 | |
19 | 19 | // Foreclosure Homes Widget. |
20 | -include( 'widgets/class-foreclosure-homes-widget.php' ); |
|
20 | +include('widgets/class-foreclosure-homes-widget.php'); |
|
21 | 21 | |
22 | 22 | // Affiliate Search Widget. |
23 | -include( 'widgets/class-affiliate-search-widget.php' ); |
|
23 | +include('widgets/class-affiliate-search-widget.php'); |
|
24 | 24 | |
25 | 25 | // Advertiser Directory Widget. |
26 | -include( 'widgets/class-advertiser-directory-widget.php' ); |
|
26 | +include('widgets/class-advertiser-directory-widget.php'); |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | /* Exit if accessed directly. */ |
9 | -if ( ! defined( 'ABSPATH' ) ) { exit; } |
|
9 | +if ( ! defined('ABSPATH')) { exit; } |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * HomeFinderForeclosureHomes class. |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | |
26 | 26 | parent::__construct( |
27 | 27 | 'homefinder_forclosure_homes', |
28 | - __( 'HomeFinder Foreclosure Homes', 're-pro' ), |
|
28 | + __('HomeFinder Foreclosure Homes', 're-pro'), |
|
29 | 29 | array( |
30 | - 'description' => __( 'Display a forclosures search box from HomeFinder.com', 're-pro' ), |
|
30 | + 'description' => __('Display a forclosures search box from HomeFinder.com', 're-pro'), |
|
31 | 31 | 'classname' => 're-pro re-pro-widget homefinder-widget homefinder-foreclosure-homes', |
32 | 32 | 'customize_selective_refresh' => true, |
33 | 33 | ) |
@@ -41,14 +41,14 @@ discard block |
||
41 | 41 | * @param mixed $args Arguments. |
42 | 42 | * @param mixed $instance Instance. |
43 | 43 | */ |
44 | - public function widget( $args, $instance ) { |
|
44 | + public function widget($args, $instance) { |
|
45 | 45 | |
46 | - $widget_id = ! empty( $args['widget_id'] ) ? $args['widget_id'] : ''; |
|
47 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
46 | + $widget_id = ! empty($args['widget_id']) ? $args['widget_id'] : ''; |
|
47 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
48 | 48 | |
49 | 49 | echo $args['before_widget']; |
50 | 50 | |
51 | - echo $args['before_title'] . esc_attr( $title ) . $args['after_title']; |
|
51 | + echo $args['before_title'] . esc_attr($title) . $args['after_title']; |
|
52 | 52 | |
53 | 53 | $homefinder_widgets = new HomeFinderWidgets(); |
54 | 54 | |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | * @param mixed $instance Instance. |
65 | 65 | * @return void |
66 | 66 | */ |
67 | - public function form( $instance ) { |
|
67 | + public function form($instance) { |
|
68 | 68 | |
69 | 69 | // Set default values. |
70 | - $instance = wp_parse_args( (array) $instance, array( |
|
70 | + $instance = wp_parse_args((array) $instance, array( |
|
71 | 71 | 'title' => '', |
72 | - ) ); |
|
72 | + )); |
|
73 | 73 | |
74 | 74 | // Retrieve an existing value from the database. |
75 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
75 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
76 | 76 | |
77 | 77 | // Title. |
78 | 78 | echo '<p>'; |
79 | - echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>'; |
|
80 | - echo ' <input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title . '" class="widefat">'; |
|
79 | + echo ' <label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>'; |
|
80 | + echo ' <input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">'; |
|
81 | 81 | echo '</p>'; |
82 | 82 | |
83 | 83 | } |
@@ -90,11 +90,11 @@ discard block |
||
90 | 90 | * @param mixed $old_instance Old Instance. |
91 | 91 | * @return $instance |
92 | 92 | */ |
93 | - public function update( $new_instance, $old_instance ) { |
|
93 | + public function update($new_instance, $old_instance) { |
|
94 | 94 | |
95 | 95 | $instance = $old_instance; |
96 | 96 | |
97 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
97 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
98 | 98 | |
99 | 99 | return $instance; |
100 | 100 | } |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | * @return void |
108 | 108 | */ |
109 | 109 | function repro_homefinder_forclosure_homes() { |
110 | - if ( ! is_ssl() ) { |
|
111 | - register_widget( 'HomeFinderForeclosureHomes' ); |
|
110 | + if ( ! is_ssl()) { |
|
111 | + register_widget('HomeFinderForeclosureHomes'); |
|
112 | 112 | } |
113 | 113 | } |
114 | -add_action( 'widgets_init', 'repro_homefinder_forclosure_homes' ); |
|
114 | +add_action('widgets_init', 'repro_homefinder_forclosure_homes'); |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | /* Exit if accessed directly. */ |
9 | -if ( ! defined( 'ABSPATH' ) ) { exit; } |
|
9 | +if ( ! defined('ABSPATH')) { exit; } |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * HomeFinderHomesForSale class. |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | |
26 | 26 | parent::__construct( |
27 | 27 | 'homefinder_homes_for_sale', |
28 | - __( 'HomeFinder Homes for Sale', 're-pro' ), |
|
28 | + __('HomeFinder Homes for Sale', 're-pro'), |
|
29 | 29 | array( |
30 | - 'description' => __( 'Display a search box from HomeFinder.com', 're-pro' ), |
|
30 | + 'description' => __('Display a search box from HomeFinder.com', 're-pro'), |
|
31 | 31 | 'classname' => 're-pro re-pro-widget homefinder-widget homefinder-homes-for-sale', |
32 | 32 | 'customize_selective_refresh' => true, |
33 | 33 | ) |
@@ -41,14 +41,14 @@ discard block |
||
41 | 41 | * @param mixed $args Arguments. |
42 | 42 | * @param mixed $instance Instance. |
43 | 43 | */ |
44 | - public function widget( $args, $instance ) { |
|
44 | + public function widget($args, $instance) { |
|
45 | 45 | |
46 | - $widget_id = ! empty( $args['widget_id'] ) ? $args['widget_id'] : ''; |
|
47 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
46 | + $widget_id = ! empty($args['widget_id']) ? $args['widget_id'] : ''; |
|
47 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
48 | 48 | |
49 | 49 | echo $args['before_widget']; |
50 | 50 | |
51 | - echo $args['before_title'] . esc_attr( $title ) . $args['after_title']; |
|
51 | + echo $args['before_title'] . esc_attr($title) . $args['after_title']; |
|
52 | 52 | |
53 | 53 | $homefinder_widgets = new HomeFinderWidgets(); |
54 | 54 | |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | * @param mixed $instance Instance. |
65 | 65 | * @return void |
66 | 66 | */ |
67 | - public function form( $instance ) { |
|
67 | + public function form($instance) { |
|
68 | 68 | |
69 | 69 | // Set default values. |
70 | - $instance = wp_parse_args( (array) $instance, array( |
|
70 | + $instance = wp_parse_args((array) $instance, array( |
|
71 | 71 | 'title' => '', |
72 | - ) ); |
|
72 | + )); |
|
73 | 73 | |
74 | 74 | // Retrieve an existing value from the database. |
75 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
75 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
76 | 76 | |
77 | 77 | // Title. |
78 | 78 | echo '<p>'; |
79 | - echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>'; |
|
80 | - echo ' <input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title . '" class="widefat">'; |
|
79 | + echo ' <label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>'; |
|
80 | + echo ' <input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">'; |
|
81 | 81 | echo '</p>'; |
82 | 82 | |
83 | 83 | } |
@@ -90,11 +90,11 @@ discard block |
||
90 | 90 | * @param mixed $old_instance Old Instance. |
91 | 91 | * @return $instance |
92 | 92 | */ |
93 | - public function update( $new_instance, $old_instance ) { |
|
93 | + public function update($new_instance, $old_instance) { |
|
94 | 94 | |
95 | 95 | $instance = $old_instance; |
96 | 96 | |
97 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
97 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
98 | 98 | |
99 | 99 | return $instance; |
100 | 100 | } |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | * @return void |
108 | 108 | */ |
109 | 109 | function repro_homefinder_homes_for_sale() { |
110 | - if ( ! is_ssl() ) { |
|
111 | - register_widget( 'HomeFinderHomesForSale' ); |
|
110 | + if ( ! is_ssl()) { |
|
111 | + register_widget('HomeFinderHomesForSale'); |
|
112 | 112 | } |
113 | 113 | } |
114 | -add_action( 'widgets_init', 'repro_homefinder_homes_for_sale' ); |
|
114 | +add_action('widgets_init', 'repro_homefinder_homes_for_sale'); |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | /* Exit if accessed directly. */ |
9 | -if ( ! defined( 'ABSPATH' ) ) { exit; } |
|
9 | +if ( ! defined('ABSPATH')) { exit; } |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * HomeFinderAdvertiserDirectory class. |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | |
26 | 26 | parent::__construct( |
27 | 27 | 'homefinder_advertiser_directory', |
28 | - __( 'HomeFinder Advertiser Directory', 're-pro' ), |
|
28 | + __('HomeFinder Advertiser Directory', 're-pro'), |
|
29 | 29 | array( |
30 | - 'description' => __( "Display your advertiser's contact information from HomeFinder.com", 're-pro' ), |
|
30 | + 'description' => __("Display your advertiser's contact information from HomeFinder.com", 're-pro'), |
|
31 | 31 | 'classname' => 're-pro re-pro-widget homefinder-widget homefinder-advertiser-directory', |
32 | 32 | 'customize_selective_refresh' => true, |
33 | 33 | ) |
@@ -41,19 +41,19 @@ discard block |
||
41 | 41 | * @param mixed $args Arguments. |
42 | 42 | * @param mixed $instance Instance. |
43 | 43 | */ |
44 | - public function widget( $args, $instance ) { |
|
44 | + public function widget($args, $instance) { |
|
45 | 45 | |
46 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
47 | - $affiliate = ! empty( $instance['affiliate'] ) ? $instance['affiliate'] : ''; |
|
48 | - $count = ! empty( $instance['count'] ) ? $instance['count'] : ''; |
|
46 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
47 | + $affiliate = ! empty($instance['affiliate']) ? $instance['affiliate'] : ''; |
|
48 | + $count = ! empty($instance['count']) ? $instance['count'] : ''; |
|
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 | 54 | $homefinder_widgets = new HomeFinderWidgets(); |
55 | 55 | |
56 | - $homefinder_widgets->get_affiliates_widget( 'directory', $instance ); |
|
56 | + $homefinder_widgets->get_affiliates_widget('directory', $instance); |
|
57 | 57 | |
58 | 58 | echo $args['after_widget']; |
59 | 59 | } |
@@ -65,37 +65,37 @@ discard block |
||
65 | 65 | * @param mixed $instance 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 | 'title' => '', |
73 | 73 | 'affiliate' => '', |
74 | 74 | 'count' => '6', |
75 | - ) ); |
|
75 | + )); |
|
76 | 76 | |
77 | 77 | // Retrieve an existing value from the database. |
78 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
79 | - $affiliate = ! empty( $instance['affiliate'] ) ? $instance['affiliate'] : ''; |
|
80 | - $count = ! empty( $instance['count'] ) ? $instance['count'] : ''; |
|
78 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
79 | + $affiliate = ! empty($instance['affiliate']) ? $instance['affiliate'] : ''; |
|
80 | + $count = ! empty($instance['count']) ? $instance['count'] : ''; |
|
81 | 81 | |
82 | 82 | // Title. |
83 | 83 | echo '<p>'; |
84 | - echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>'; |
|
85 | - echo ' <input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title . '" class="widefat">'; |
|
84 | + echo ' <label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>'; |
|
85 | + echo ' <input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">'; |
|
86 | 86 | echo '</p>'; |
87 | 87 | |
88 | 88 | // Affiliate Profile Name. |
89 | 89 | echo '<p>'; |
90 | - echo ' <label for="' . $this->get_field_id( 'affiliate' ) . '" class="title-label">' . __( 'Affiliate Profile Name:', 're-pro' ) . '</label>'; |
|
91 | - echo ' <input id="' . $this->get_field_id( 'affiliate' ) . '" name="' . $this->get_field_name( 'affiliate' ) . '" value="' . $affiliate . '" class="widefat">'; |
|
90 | + echo ' <label for="' . $this->get_field_id('affiliate') . '" class="title-label">' . __('Affiliate Profile Name:', 're-pro') . '</label>'; |
|
91 | + echo ' <input id="' . $this->get_field_id('affiliate') . '" name="' . $this->get_field_name('affiliate') . '" value="' . $affiliate . '" class="widefat">'; |
|
92 | 92 | echo '</p>'; |
93 | 93 | |
94 | 94 | // Max Count. |
95 | 95 | echo '<p>'; |
96 | - echo ' <label for="' . $this->get_field_id( 'count' ) . '" class="title-label">' . __( 'Display Count:', 're-pro' ) . '</label>'; |
|
97 | - echo ' <input type="number" id="' . $this->get_field_id( 'count' ) . '" name="' . $this->get_field_name( 'count' ) . '" min="1" max="50" value="' . $count . '">'; |
|
98 | - echo ' <span class="description">' . __( 'Max Count: 50', 're-pro' ) . '</span>'; |
|
96 | + echo ' <label for="' . $this->get_field_id('count') . '" class="title-label">' . __('Display Count:', 're-pro') . '</label>'; |
|
97 | + echo ' <input type="number" id="' . $this->get_field_id('count') . '" name="' . $this->get_field_name('count') . '" min="1" max="50" value="' . $count . '">'; |
|
98 | + echo ' <span class="description">' . __('Max Count: 50', 're-pro') . '</span>'; |
|
99 | 99 | echo '</p>'; |
100 | 100 | |
101 | 101 | } |
@@ -108,13 +108,13 @@ discard block |
||
108 | 108 | * @param mixed $old_instance Old Instance. |
109 | 109 | * @return $instance |
110 | 110 | */ |
111 | - public function update( $new_instance, $old_instance ) { |
|
111 | + public function update($new_instance, $old_instance) { |
|
112 | 112 | |
113 | 113 | $instance = $old_instance; |
114 | 114 | |
115 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
116 | - $instance['affiliate'] = ! empty( $new_instance['affiliate'] ) ? strip_tags( $new_instance['affiliate'] ) : ''; |
|
117 | - $instance['count'] = ! empty( $new_instance['count'] ) ? strip_tags( $new_instance['count'] ) : ''; |
|
115 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
116 | + $instance['affiliate'] = ! empty($new_instance['affiliate']) ? strip_tags($new_instance['affiliate']) : ''; |
|
117 | + $instance['count'] = ! empty($new_instance['count']) ? strip_tags($new_instance['count']) : ''; |
|
118 | 118 | |
119 | 119 | return $instance; |
120 | 120 | } |
@@ -127,8 +127,8 @@ discard block |
||
127 | 127 | * @return void |
128 | 128 | */ |
129 | 129 | function repro_homefinder_advertiser_directory() { |
130 | - if ( ! is_ssl() ) { |
|
131 | - register_widget( 'HomeFinderAdvertiserDirectory' ); |
|
130 | + if ( ! is_ssl()) { |
|
131 | + register_widget('HomeFinderAdvertiserDirectory'); |
|
132 | 132 | } |
133 | 133 | } |
134 | -add_action( 'widgets_init', 'repro_homefinder_advertiser_directory' ); |
|
134 | +add_action('widgets_init', 'repro_homefinder_advertiser_directory'); |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | /* Exit if accessed directly. */ |
9 | -if ( ! defined( 'ABSPATH' ) ) { exit; } |
|
9 | +if ( ! defined('ABSPATH')) { exit; } |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * HomeFinderAffiliateSearch class. |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | |
26 | 26 | parent::__construct( |
27 | 27 | 'homefinder_affiliate_search', |
28 | - __( 'HomeFinder Affiliate Search', 're-pro' ), |
|
28 | + __('HomeFinder Affiliate Search', 're-pro'), |
|
29 | 29 | array( |
30 | - 'description' => __( 'Display an affiliate search box from HomeFinder.com', 're-pro' ), |
|
30 | + 'description' => __('Display an affiliate search box from HomeFinder.com', 're-pro'), |
|
31 | 31 | 'classname' => 're-pro re-pro-widget homefinder-widget homefinder-affiliate-search', |
32 | 32 | 'customize_selective_refresh' => true, |
33 | 33 | ) |
@@ -41,28 +41,28 @@ discard block |
||
41 | 41 | * @param mixed $args Arguments. |
42 | 42 | * @param mixed $instance Instance. |
43 | 43 | */ |
44 | - public function widget( $args, $instance ) { |
|
45 | - |
|
46 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
47 | - $affiliate = ! empty( $instance['affiliate'] ) ? $instance['affiliate'] : ''; |
|
48 | - $primary_city = ! empty( $instance['primary_city'] ) ? $instance['primary_city'] : ''; |
|
49 | - $primary_state = ! empty( $instance['primary_state'] ) ? $instance['primary_state'] : ''; |
|
50 | - $nearby_city_1 = ! empty( $instance['nearby_city_1'] ) ? $instance['nearby_city_1'] : ''; |
|
51 | - $nearby_state_1 = ! empty( $instance['nearby_state_1'] ) ? $instance['nearby_state_1'] : ''; |
|
52 | - $nearby_city_2 = ! empty( $instance['nearby_city_2'] ) ? $instance['nearby_city_2'] : ''; |
|
53 | - $nearby_state_2 = ! empty( $instance['nearby_state_2'] ) ? $instance['nearby_state_2'] : ''; |
|
54 | - $nearby_city_3 = ! empty( $instance['nearby_city_3'] ) ? $instance['nearby_city_3'] : ''; |
|
55 | - $nearby_state_3 = ! empty( $instance['nearby_state_3'] ) ? $instance['nearby_state_3'] : ''; |
|
56 | - $nearby_city_4 = ! empty( $instance['nearby_city_4'] ) ? $instance['nearby_city_4'] : ''; |
|
57 | - $nearby_state_4 = ! empty( $instance['nearby_state_4'] ) ? $instance['nearby_state_4'] : ''; |
|
44 | + public function widget($args, $instance) { |
|
45 | + |
|
46 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
47 | + $affiliate = ! empty($instance['affiliate']) ? $instance['affiliate'] : ''; |
|
48 | + $primary_city = ! empty($instance['primary_city']) ? $instance['primary_city'] : ''; |
|
49 | + $primary_state = ! empty($instance['primary_state']) ? $instance['primary_state'] : ''; |
|
50 | + $nearby_city_1 = ! empty($instance['nearby_city_1']) ? $instance['nearby_city_1'] : ''; |
|
51 | + $nearby_state_1 = ! empty($instance['nearby_state_1']) ? $instance['nearby_state_1'] : ''; |
|
52 | + $nearby_city_2 = ! empty($instance['nearby_city_2']) ? $instance['nearby_city_2'] : ''; |
|
53 | + $nearby_state_2 = ! empty($instance['nearby_state_2']) ? $instance['nearby_state_2'] : ''; |
|
54 | + $nearby_city_3 = ! empty($instance['nearby_city_3']) ? $instance['nearby_city_3'] : ''; |
|
55 | + $nearby_state_3 = ! empty($instance['nearby_state_3']) ? $instance['nearby_state_3'] : ''; |
|
56 | + $nearby_city_4 = ! empty($instance['nearby_city_4']) ? $instance['nearby_city_4'] : ''; |
|
57 | + $nearby_state_4 = ! empty($instance['nearby_state_4']) ? $instance['nearby_state_4'] : ''; |
|
58 | 58 | |
59 | 59 | echo $args['before_widget']; |
60 | 60 | |
61 | - echo $args['before_title'] . esc_attr( $title ) . $args['after_title']; |
|
61 | + echo $args['before_title'] . esc_attr($title) . $args['after_title']; |
|
62 | 62 | |
63 | 63 | $homefinder_widgets = new HomeFinderWidgets(); |
64 | 64 | |
65 | - $homefinder_widgets->get_affiliates_widget( 'search', $instance ); |
|
65 | + $homefinder_widgets->get_affiliates_widget('search', $instance); |
|
66 | 66 | |
67 | 67 | echo $args['after_widget']; |
68 | 68 | } |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | * @param mixed $instance Instance. |
75 | 75 | * @return void |
76 | 76 | */ |
77 | - public function form( $instance ) { |
|
77 | + public function form($instance) { |
|
78 | 78 | |
79 | 79 | // Set default values. |
80 | - $instance = wp_parse_args( (array) $instance, array( |
|
80 | + $instance = wp_parse_args((array) $instance, array( |
|
81 | 81 | 'title' => '', |
82 | 82 | 'affiliate' => '', |
83 | 83 | 'primary_city' => '', |
@@ -90,77 +90,77 @@ discard block |
||
90 | 90 | 'nearby_state_3' => '', |
91 | 91 | 'nearby_city_4' => '', |
92 | 92 | 'nearby_state_4' => '', |
93 | - ) ); |
|
93 | + )); |
|
94 | 94 | |
95 | 95 | // Retrieve an existing value from the database. |
96 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
97 | - $affiliate = ! empty( $instance['affiliate'] ) ? $instance['affiliate'] : ''; |
|
98 | - $primary_city = ! empty( $instance['primary_city'] ) ? $instance['primary_city'] : ''; |
|
99 | - $primary_state = ! empty( $instance['primary_state'] ) ? $instance['primary_state'] : ''; |
|
100 | - $nearby_city_1 = ! empty( $instance['nearby_city_1'] ) ? $instance['nearby_city_1'] : ''; |
|
101 | - $nearby_state_1 = ! empty( $instance['nearby_state_1'] ) ? $instance['nearby_state_1'] : ''; |
|
102 | - $nearby_city_2 = ! empty( $instance['nearby_city_2'] ) ? $instance['nearby_city_2'] : ''; |
|
103 | - $nearby_state_2 = ! empty( $instance['nearby_state_2'] ) ? $instance['nearby_state_2'] : ''; |
|
104 | - $nearby_city_3 = ! empty( $instance['nearby_city_3'] ) ? $instance['nearby_city_3'] : ''; |
|
105 | - $nearby_state_3 = ! empty( $instance['nearby_state_3'] ) ? $instance['nearby_state_3'] : ''; |
|
106 | - $nearby_city_4 = ! empty( $instance['nearby_city_4'] ) ? $instance['nearby_city_4'] : ''; |
|
107 | - $nearby_state_4 = ! empty( $instance['nearby_state_4'] ) ? $instance['nearby_state_4'] : ''; |
|
96 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
97 | + $affiliate = ! empty($instance['affiliate']) ? $instance['affiliate'] : ''; |
|
98 | + $primary_city = ! empty($instance['primary_city']) ? $instance['primary_city'] : ''; |
|
99 | + $primary_state = ! empty($instance['primary_state']) ? $instance['primary_state'] : ''; |
|
100 | + $nearby_city_1 = ! empty($instance['nearby_city_1']) ? $instance['nearby_city_1'] : ''; |
|
101 | + $nearby_state_1 = ! empty($instance['nearby_state_1']) ? $instance['nearby_state_1'] : ''; |
|
102 | + $nearby_city_2 = ! empty($instance['nearby_city_2']) ? $instance['nearby_city_2'] : ''; |
|
103 | + $nearby_state_2 = ! empty($instance['nearby_state_2']) ? $instance['nearby_state_2'] : ''; |
|
104 | + $nearby_city_3 = ! empty($instance['nearby_city_3']) ? $instance['nearby_city_3'] : ''; |
|
105 | + $nearby_state_3 = ! empty($instance['nearby_state_3']) ? $instance['nearby_state_3'] : ''; |
|
106 | + $nearby_city_4 = ! empty($instance['nearby_city_4']) ? $instance['nearby_city_4'] : ''; |
|
107 | + $nearby_state_4 = ! empty($instance['nearby_state_4']) ? $instance['nearby_state_4'] : ''; |
|
108 | 108 | |
109 | 109 | // Title. |
110 | 110 | echo '<p>'; |
111 | - echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>'; |
|
112 | - echo ' <input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title . '" class="widefat">'; |
|
111 | + echo ' <label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>'; |
|
112 | + echo ' <input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">'; |
|
113 | 113 | echo '</p>'; |
114 | 114 | |
115 | 115 | // Affiliate Name. |
116 | 116 | echo '<p>'; |
117 | - echo ' <label for="' . $this->get_field_id( 'affiliate' ) . '" class="title-label">' . __( 'Affiliate Name:', 're-pro' ) . '</label>'; |
|
118 | - echo ' <input id="' . $this->get_field_id( 'affiliate' ) . '" name="' . $this->get_field_name( 'affiliate' ) . '" value="' . $affiliate . '" class="widefat">'; |
|
117 | + echo ' <label for="' . $this->get_field_id('affiliate') . '" class="title-label">' . __('Affiliate Name:', 're-pro') . '</label>'; |
|
118 | + echo ' <input id="' . $this->get_field_id('affiliate') . '" name="' . $this->get_field_name('affiliate') . '" value="' . $affiliate . '" class="widefat">'; |
|
119 | 119 | echo '</p>'; |
120 | 120 | |
121 | 121 | // Primary Search Area. |
122 | 122 | echo '<p>'; |
123 | - echo ' <label for="primary-search-area" class="title-label">' . __( 'Primary Search Area:', 're-pro' ) . '</label>'; |
|
124 | - echo ' <input id="' . $this->get_field_id( 'primary_city' ) . '" name="' . $this->get_field_name( 'primary_city' ) . '" value="' . $primary_city . '" class="widefat">'; |
|
125 | - echo ' <span class="description">' . __( 'City', 're-pro' ) . '</span>'; |
|
126 | - echo ' <input id="' . $this->get_field_id( 'primary_state' ) . '" name="' . $this->get_field_name( 'primary_state' ) . '" value="' . $primary_state . '" class="widefat">'; |
|
127 | - echo ' <span class="description">' . __( 'State', 're-pro' ) . '</span>'; |
|
123 | + echo ' <label for="primary-search-area" class="title-label">' . __('Primary Search Area:', 're-pro') . '</label>'; |
|
124 | + echo ' <input id="' . $this->get_field_id('primary_city') . '" name="' . $this->get_field_name('primary_city') . '" value="' . $primary_city . '" class="widefat">'; |
|
125 | + echo ' <span class="description">' . __('City', 're-pro') . '</span>'; |
|
126 | + echo ' <input id="' . $this->get_field_id('primary_state') . '" name="' . $this->get_field_name('primary_state') . '" value="' . $primary_state . '" class="widefat">'; |
|
127 | + echo ' <span class="description">' . __('State', 're-pro') . '</span>'; |
|
128 | 128 | echo '</p>'; |
129 | 129 | |
130 | 130 | // Nearby Area 1. |
131 | 131 | echo '<p>'; |
132 | - echo ' <label for="nearby-area-1" class="title-label">' . __( 'Nearby Area 1:', 're-pro' ) . '</label>'; |
|
133 | - echo ' <input id="' . $this->get_field_id( 'nearby_city_1' ) . '" name="' . $this->get_field_name( 'nearby_city_1' ) . '" value="' . $nearby_city_1 . '" class="widefat">'; |
|
134 | - echo ' <span class="description">' . __( 'City', 're-pro' ) . '</span>'; |
|
135 | - echo ' <input id="' . $this->get_field_id( 'nearby_state_1' ) . '" name="' . $this->get_field_name( 'nearby_state_1' ) . '" value="' . $nearby_state_1 . '" class="widefat">'; |
|
136 | - echo ' <span class="description">' . __( 'State', 're-pro' ) . '</span>'; |
|
132 | + echo ' <label for="nearby-area-1" class="title-label">' . __('Nearby Area 1:', 're-pro') . '</label>'; |
|
133 | + echo ' <input id="' . $this->get_field_id('nearby_city_1') . '" name="' . $this->get_field_name('nearby_city_1') . '" value="' . $nearby_city_1 . '" class="widefat">'; |
|
134 | + echo ' <span class="description">' . __('City', 're-pro') . '</span>'; |
|
135 | + echo ' <input id="' . $this->get_field_id('nearby_state_1') . '" name="' . $this->get_field_name('nearby_state_1') . '" value="' . $nearby_state_1 . '" class="widefat">'; |
|
136 | + echo ' <span class="description">' . __('State', 're-pro') . '</span>'; |
|
137 | 137 | echo '</p>'; |
138 | 138 | |
139 | 139 | // Nearby Area 2. |
140 | 140 | echo '<p>'; |
141 | - echo ' <label for="nearby-area-2" class="title-label">' . __( 'Nearby Area 2:', 're-pro' ) . '</label>'; |
|
142 | - echo ' <input id="' . $this->get_field_id( 'nearby_city_2' ) . '" name="' . $this->get_field_name( 'nearby_city_2' ) . '" value="' . $nearby_city_2 . '" class="widefat">'; |
|
143 | - echo ' <span class="description">' . __( 'City', 're-pro' ) . '</span>'; |
|
144 | - echo ' <input id="' . $this->get_field_id( 'nearby_state_2' ) . '" name="' . $this->get_field_name( 'nearby_state_2' ) . '" value="' . $nearby_state_2 . '" class="widefat">'; |
|
145 | - echo ' <span class="description">' . __( 'State', 're-pro' ) . '</span>'; |
|
141 | + echo ' <label for="nearby-area-2" class="title-label">' . __('Nearby Area 2:', 're-pro') . '</label>'; |
|
142 | + echo ' <input id="' . $this->get_field_id('nearby_city_2') . '" name="' . $this->get_field_name('nearby_city_2') . '" value="' . $nearby_city_2 . '" class="widefat">'; |
|
143 | + echo ' <span class="description">' . __('City', 're-pro') . '</span>'; |
|
144 | + echo ' <input id="' . $this->get_field_id('nearby_state_2') . '" name="' . $this->get_field_name('nearby_state_2') . '" value="' . $nearby_state_2 . '" class="widefat">'; |
|
145 | + echo ' <span class="description">' . __('State', 're-pro') . '</span>'; |
|
146 | 146 | echo '</p>'; |
147 | 147 | |
148 | 148 | // Nearby Area 3. |
149 | 149 | echo '<p>'; |
150 | - echo ' <label for="nearby-area-3" class="title-label">' . __( 'Nearby Area 3:', 're-pro' ) . '</label>'; |
|
151 | - echo ' <input id="' . $this->get_field_id( 'nearby_city_3' ) . '" name="' . $this->get_field_name( 'nearby_city_3' ) . '" value="' . $nearby_city_3 . '" class="widefat">'; |
|
152 | - echo ' <span class="description">' . __( 'City', 're-pro' ) . '</span>'; |
|
153 | - echo ' <input id="' . $this->get_field_id( 'nearby_state_3' ) . '" name="' . $this->get_field_name( 'nearby_state_3' ) . '" value="' . $nearby_state_3 . '" class="widefat">'; |
|
154 | - echo ' <span class="description">' . __( 'State', 're-pro' ) . '</span>'; |
|
150 | + echo ' <label for="nearby-area-3" class="title-label">' . __('Nearby Area 3:', 're-pro') . '</label>'; |
|
151 | + echo ' <input id="' . $this->get_field_id('nearby_city_3') . '" name="' . $this->get_field_name('nearby_city_3') . '" value="' . $nearby_city_3 . '" class="widefat">'; |
|
152 | + echo ' <span class="description">' . __('City', 're-pro') . '</span>'; |
|
153 | + echo ' <input id="' . $this->get_field_id('nearby_state_3') . '" name="' . $this->get_field_name('nearby_state_3') . '" value="' . $nearby_state_3 . '" class="widefat">'; |
|
154 | + echo ' <span class="description">' . __('State', 're-pro') . '</span>'; |
|
155 | 155 | echo '</p>'; |
156 | 156 | |
157 | 157 | // Nearby Area 4. |
158 | 158 | echo '<p>'; |
159 | - echo ' <label for="nearby-area-4" class="title-label">' . __( 'Nearby Area 4:', 're-pro' ) . '</label>'; |
|
160 | - echo ' <input id="' . $this->get_field_id( 'nearby_city_4' ) . '" name="' . $this->get_field_name( 'nearby_city_4' ) . '" value="' . $nearby_city_4 . '" class="widefat">'; |
|
161 | - echo ' <span class="description">' . __( 'City', 're-pro' ) . '</span>'; |
|
162 | - echo ' <input id="' . $this->get_field_id( 'nearby_state_4' ) . '" name="' . $this->get_field_name( 'nearby_state_4' ) . '" value="' . $nearby_state_4 . '" class="widefat">'; |
|
163 | - echo ' <span class="description">' . __( 'State', 're-pro' ) . '</span>'; |
|
159 | + echo ' <label for="nearby-area-4" class="title-label">' . __('Nearby Area 4:', 're-pro') . '</label>'; |
|
160 | + echo ' <input id="' . $this->get_field_id('nearby_city_4') . '" name="' . $this->get_field_name('nearby_city_4') . '" value="' . $nearby_city_4 . '" class="widefat">'; |
|
161 | + echo ' <span class="description">' . __('City', 're-pro') . '</span>'; |
|
162 | + echo ' <input id="' . $this->get_field_id('nearby_state_4') . '" name="' . $this->get_field_name('nearby_state_4') . '" value="' . $nearby_state_4 . '" class="widefat">'; |
|
163 | + echo ' <span class="description">' . __('State', 're-pro') . '</span>'; |
|
164 | 164 | echo '</p>'; |
165 | 165 | |
166 | 166 | } |
@@ -173,22 +173,22 @@ discard block |
||
173 | 173 | * @param mixed $old_instance Old Instance. |
174 | 174 | * @return $instance |
175 | 175 | */ |
176 | - public function update( $new_instance, $old_instance ) { |
|
176 | + public function update($new_instance, $old_instance) { |
|
177 | 177 | |
178 | 178 | $instance = $old_instance; |
179 | 179 | |
180 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
181 | - $instance['affiliate'] = ! empty( $new_instance['affiliate'] ) ? strip_tags( $new_instance['affiliate'] ) : ''; |
|
182 | - $instance['primary_city'] = ! empty( $new_instance['primary_city'] ) ? strip_tags( $new_instance['primary_city'] ) : ''; |
|
183 | - $instance['primary_state'] = ! empty( $new_instance['primary_state'] ) ? strip_tags( $new_instance['primary_state'] ) : ''; |
|
184 | - $instance['nearby_city_1'] = ! empty( $new_instance['nearby_city_1'] ) ? strip_tags( $new_instance['nearby_city_1'] ) : ''; |
|
185 | - $instance['nearby_city_2'] = ! empty( $new_instance['nearby_city_2'] ) ? strip_tags( $new_instance['nearby_city_2'] ) : ''; |
|
186 | - $instance['nearby_city_3'] = ! empty( $new_instance['nearby_city_3'] ) ? strip_tags( $new_instance['nearby_city_3'] ) : ''; |
|
187 | - $instance['nearby_city_4'] = ! empty( $new_instance['nearby_city_4'] ) ? strip_tags( $new_instance['nearby_city_4'] ) : ''; |
|
188 | - $instance['nearby_state_1'] = ! empty( $new_instance['nearby_state_1'] ) ? strip_tags( $new_instance['nearby_state_1'] ) : ''; |
|
189 | - $instance['nearby_state_2'] = ! empty( $new_instance['nearby_state_2'] ) ? strip_tags( $new_instance['nearby_state_2'] ) : ''; |
|
190 | - $instance['nearby_state_3'] = ! empty( $new_instance['nearby_state_3'] ) ? strip_tags( $new_instance['nearby_state_3'] ) : ''; |
|
191 | - $instance['nearby_state_4'] = ! empty( $new_instance['nearby_state_4'] ) ? strip_tags( $new_instance['nearby_state_4'] ) : ''; |
|
180 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
181 | + $instance['affiliate'] = ! empty($new_instance['affiliate']) ? strip_tags($new_instance['affiliate']) : ''; |
|
182 | + $instance['primary_city'] = ! empty($new_instance['primary_city']) ? strip_tags($new_instance['primary_city']) : ''; |
|
183 | + $instance['primary_state'] = ! empty($new_instance['primary_state']) ? strip_tags($new_instance['primary_state']) : ''; |
|
184 | + $instance['nearby_city_1'] = ! empty($new_instance['nearby_city_1']) ? strip_tags($new_instance['nearby_city_1']) : ''; |
|
185 | + $instance['nearby_city_2'] = ! empty($new_instance['nearby_city_2']) ? strip_tags($new_instance['nearby_city_2']) : ''; |
|
186 | + $instance['nearby_city_3'] = ! empty($new_instance['nearby_city_3']) ? strip_tags($new_instance['nearby_city_3']) : ''; |
|
187 | + $instance['nearby_city_4'] = ! empty($new_instance['nearby_city_4']) ? strip_tags($new_instance['nearby_city_4']) : ''; |
|
188 | + $instance['nearby_state_1'] = ! empty($new_instance['nearby_state_1']) ? strip_tags($new_instance['nearby_state_1']) : ''; |
|
189 | + $instance['nearby_state_2'] = ! empty($new_instance['nearby_state_2']) ? strip_tags($new_instance['nearby_state_2']) : ''; |
|
190 | + $instance['nearby_state_3'] = ! empty($new_instance['nearby_state_3']) ? strip_tags($new_instance['nearby_state_3']) : ''; |
|
191 | + $instance['nearby_state_4'] = ! empty($new_instance['nearby_state_4']) ? strip_tags($new_instance['nearby_state_4']) : ''; |
|
192 | 192 | |
193 | 193 | return $instance; |
194 | 194 | } |
@@ -201,8 +201,8 @@ discard block |
||
201 | 201 | * @return void |
202 | 202 | */ |
203 | 203 | function repro_homefinder_affiliate_search() { |
204 | - if ( ! is_ssl() ) { |
|
205 | - register_widget( 'HomeFinderAffiliateSearch' ); |
|
204 | + if ( ! is_ssl()) { |
|
205 | + register_widget('HomeFinderAffiliateSearch'); |
|
206 | 206 | } |
207 | 207 | } |
208 | -add_action( 'widgets_init', 'repro_homefinder_affiliate_search' ); |
|
208 | +add_action('widgets_init', 'repro_homefinder_affiliate_search'); |
@@ -6,9 +6,9 @@ discard block |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | // Exit if accessed directly. |
9 | -if ( ! defined( 'ABSPATH' ) ) { exit; } |
|
9 | +if ( ! defined('ABSPATH')) { exit; } |
|
10 | 10 | |
11 | -if ( ! class_exists( 'HomeFinderWidgets' ) ) { |
|
11 | +if ( ! class_exists('HomeFinderWidgets')) { |
|
12 | 12 | /** |
13 | 13 | * HomeFinderWidgets class. |
14 | 14 | */ |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * @return void |
29 | 29 | */ |
30 | 30 | public function __construct() { |
31 | - add_action( 'wp_footer', array( $this, 'hf_enqueue' ) ); |
|
31 | + add_action('wp_footer', array($this, 'hf_enqueue')); |
|
32 | 32 | |
33 | 33 | } |
34 | 34 | |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | * Enqueue JS on footer and handle multiple widgets. |
37 | 37 | */ |
38 | 38 | public function hf_enqueue() { |
39 | - wp_enqueue_script( 'hf-widget-loader', 'http://www.homefinder.com/widgets/js/widgetLoader.js', array( 'jquery' ), null, true ); |
|
40 | - wp_enqueue_script( 'hf-widgets-js', plugins_url( 'homefinder-widgets.js', __FILE__ ), array( 'jquery' ), null, true ); |
|
41 | - wp_localize_script( 'hf-widgets-js', 'hf_data', static::$hf_data ); |
|
39 | + wp_enqueue_script('hf-widget-loader', 'http://www.homefinder.com/widgets/js/widgetLoader.js', array('jquery'), null, true); |
|
40 | + wp_enqueue_script('hf-widgets-js', plugins_url('homefinder-widgets.js', __FILE__), array('jquery'), null, true); |
|
41 | + wp_localize_script('hf-widgets-js', 'hf_data', static::$hf_data); |
|
42 | 42 | |
43 | 43 | } |
44 | 44 | |
@@ -49,10 +49,10 @@ discard block |
||
49 | 49 | * @param string $widget_id (default: ''). |
50 | 50 | * @return string $widget_id. |
51 | 51 | */ |
52 | - public function homefinder_id( $widget_id = '' ) { |
|
52 | + public function homefinder_id($widget_id = '') { |
|
53 | 53 | |
54 | - if ( '' !== $widget_id ) { |
|
55 | - return sanitize_html_class( $widget_id ); |
|
54 | + if ('' !== $widget_id) { |
|
55 | + return sanitize_html_class($widget_id); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | } |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | * @param string $widget_name (default: ''). |
65 | 65 | * @return string class name. |
66 | 66 | */ |
67 | - public function homefinder_class( $widget_name = '' ) { |
|
67 | + public function homefinder_class($widget_name = '') { |
|
68 | 68 | |
69 | - if ( '' !== $widget_name ) { |
|
70 | - return 'homefinder homefinder-widget homefinder-' . sanitize_html_class( $widget_name ) . '-widget'; |
|
69 | + if ('' !== $widget_name) { |
|
70 | + return 'homefinder homefinder-widget homefinder-' . sanitize_html_class($widget_name) . '-widget'; |
|
71 | 71 | } else { |
72 | 72 | return 'homefinder homefinder-widget'; |
73 | 73 | } |
@@ -90,9 +90,9 @@ discard block |
||
90 | 90 | ); |
91 | 91 | static::$hf_data[] = $widget_data; |
92 | 92 | |
93 | - $index = count( static::$hf_data ) - 1; |
|
93 | + $index = count(static::$hf_data) - 1; |
|
94 | 94 | |
95 | - echo '<div id="homeSearchWidget-'. $index .'" class="'. $this->homefinder_class( 'homes-for-sale' ) .'"></div>'; |
|
95 | + echo '<div id="homeSearchWidget-' . $index . '" class="' . $this->homefinder_class('homes-for-sale') . '"></div>'; |
|
96 | 96 | |
97 | 97 | } |
98 | 98 | |
@@ -110,9 +110,9 @@ discard block |
||
110 | 110 | ); |
111 | 111 | static::$hf_data[] = $widget_data; |
112 | 112 | |
113 | - $index = count( static::$hf_data ) - 1; |
|
113 | + $index = count(static::$hf_data) - 1; |
|
114 | 114 | |
115 | - echo '<div id="openHouseSearchWidget-'. $index .'" class="'. $this->homefinder_class( 'open-house' ) .'"></div>'; |
|
115 | + echo '<div id="openHouseSearchWidget-' . $index . '" class="' . $this->homefinder_class('open-house') . '"></div>'; |
|
116 | 116 | |
117 | 117 | } |
118 | 118 | |
@@ -130,9 +130,9 @@ discard block |
||
130 | 130 | ); |
131 | 131 | static::$hf_data[] = $widget_data; |
132 | 132 | |
133 | - $index = count( static::$hf_data ) - 1; |
|
133 | + $index = count(static::$hf_data) - 1; |
|
134 | 134 | |
135 | - echo '<div id="foreclosureSearchWidget-'. $index .'" class="'. $this->homefinder_class( 'foreclosure-homes' ) .'"></div>'; |
|
135 | + echo '<div id="foreclosureSearchWidget-' . $index . '" class="' . $this->homefinder_class('foreclosure-homes') . '"></div>'; |
|
136 | 136 | |
137 | 137 | } |
138 | 138 | |
@@ -144,17 +144,17 @@ discard block |
||
144 | 144 | * @param [Mixed] $widget_data : Array of widget data to send to js. |
145 | 145 | * @return void |
146 | 146 | */ |
147 | - public function get_affiliates_widget( $type, $widget_data ) { |
|
147 | + public function get_affiliates_widget($type, $widget_data) { |
|
148 | 148 | |
149 | 149 | $widget_data['type'] = $type; |
150 | 150 | static::$hf_data[] = $widget_data; |
151 | 151 | |
152 | - $index = count( static::$hf_data ) - 1; |
|
152 | + $index = count(static::$hf_data) - 1; |
|
153 | 153 | |
154 | - if ( 'search' === $type ) { |
|
155 | - echo '<div id="searchPreview-' . $index . '" class="'. $this->homefinder_class( 'affiliate-search' ) .'"><div>'; |
|
156 | - } else if ( 'directory' === $type ) { |
|
157 | - echo '<div id="directoryPreview-' . $index . '" class="'. $this->homefinder_class( 'adveritser-directory' ) .'"></div>'; |
|
154 | + if ('search' === $type) { |
|
155 | + echo '<div id="searchPreview-' . $index . '" class="' . $this->homefinder_class('affiliate-search') . '"><div>'; |
|
156 | + } else if ('directory' === $type) { |
|
157 | + echo '<div id="directoryPreview-' . $index . '" class="' . $this->homefinder_class('adveritser-directory') . '"></div>'; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | } |