@@ -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 Rate Table Widget (https://www.zillow.com/webtools/widgets/large-rate-table-widget/) |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | |
28 | 28 | parent::__construct( |
29 | 29 | 'zillow_lg_ratetable_widget', |
30 | - __( 'Zillow Large Mortgage Rate Table', 're-pro' ), |
|
30 | + __('Zillow Large Mortgage Rate Table', 're-pro'), |
|
31 | 31 | array( |
32 | - 'description' => __( 'Display a large Mortgage Rate Table from Zillow.', 're-pro' ), |
|
32 | + 'description' => __('Display a large Mortgage Rate Table from Zillow.', 're-pro'), |
|
33 | 33 | 'classname' => 're-pro re-pro-widget zillow-widget zillow-widget-lg-rate-table', |
34 | 34 | 'customize_selective_refresh' => true, |
35 | 35 | ) |
@@ -44,19 +44,19 @@ 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 | |
53 | 53 | echo $args['before_widget']; |
54 | 54 | |
55 | - echo $args['before_title'] . esc_attr( $title ) . $args['after_title']; |
|
55 | + echo $args['before_title'] . esc_attr($title) . $args['after_title']; |
|
56 | 56 | |
57 | 57 | $zillow_widgets = new ZillowWidgets(); |
58 | 58 | |
59 | - return $zillow_widgets->get_mortage_rate_widget( $iframe_id ); |
|
59 | + return $zillow_widgets->get_mortage_rate_widget($iframe_id); |
|
60 | 60 | |
61 | 61 | echo $args['after_widget']; |
62 | 62 | } |
@@ -68,20 +68,20 @@ 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 | )); |
77 | 77 | |
78 | 78 | // Retrieve an existing value from the database. |
79 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
79 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
80 | 80 | |
81 | 81 | // Title. |
82 | 82 | echo '<p>'; |
83 | - echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>'; |
|
84 | - echo ' <input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title . '" class="widefat">'; |
|
83 | + echo ' <label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>'; |
|
84 | + echo ' <input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">'; |
|
85 | 85 | echo '</p>'; |
86 | 86 | |
87 | 87 | } |
@@ -94,11 +94,11 @@ discard block |
||
94 | 94 | * @param mixed $old_instance Old Instance. |
95 | 95 | * @return $instance |
96 | 96 | */ |
97 | - public function update( $new_instance, $old_instance ) { |
|
97 | + public function update($new_instance, $old_instance) { |
|
98 | 98 | |
99 | 99 | $instance = $old_instance; |
100 | 100 | |
101 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
101 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
102 | 102 | |
103 | 103 | return $instance; |
104 | 104 | } |
@@ -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 Past Sales Widget (https://www.zillow.com/webtools/widgets/PastListingsWidget.htm) |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | |
28 | 28 | parent::__construct( |
29 | 29 | 'zillow_past_sales_widget', |
30 | - __( 'Zillow Past Sales', 're-pro' ), |
|
30 | + __('Zillow Past Sales', 're-pro'), |
|
31 | 31 | array( |
32 | - 'description' => __( 'Display your past sales from Zillow.', 're-pro' ), |
|
32 | + 'description' => __('Display your past sales from Zillow.', 're-pro'), |
|
33 | 33 | 'classname' => 're-pro re-pro-widget zillow-widget zillow-widget-past-sales', |
34 | 34 | 'customize_selective_refresh' => true, |
35 | 35 | ) |
@@ -44,20 +44,20 @@ 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 | - $zuid = ! empty( $instance['zuid'] ) ? $instance['zuid'] : ''; |
|
49 | + $iframe_id = ! empty($args['widget_id']) ? $args['widget_id'] : ''; |
|
50 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
51 | + $zuid = ! empty($instance['zuid']) ? $instance['zuid'] : ''; |
|
52 | 52 | |
53 | 53 | |
54 | 54 | echo $args['before_widget']; |
55 | 55 | |
56 | - echo $args['before_title'] . esc_attr( $title ) . $args['after_title']; |
|
56 | + echo $args['before_title'] . esc_attr($title) . $args['after_title']; |
|
57 | 57 | |
58 | 58 | $zillow_widgets = new ZillowWidgets(); |
59 | 59 | |
60 | - return $zillow_widgets->get_past_listings_widget( $iframe_id, $zuid ); |
|
60 | + return $zillow_widgets->get_past_listings_widget($iframe_id, $zuid); |
|
61 | 61 | |
62 | 62 | echo $args['after_widget']; |
63 | 63 | } |
@@ -69,30 +69,30 @@ discard block |
||
69 | 69 | * @param mixed $instance Instance. |
70 | 70 | * @return void |
71 | 71 | */ |
72 | - public function form( $instance ) { |
|
72 | + public function form($instance) { |
|
73 | 73 | |
74 | 74 | // Set default values. |
75 | - $instance = wp_parse_args( (array) $instance, array( |
|
75 | + $instance = wp_parse_args((array) $instance, array( |
|
76 | 76 | 'title' => '', |
77 | 77 | 'zuid' => '', |
78 | 78 | )); |
79 | 79 | |
80 | 80 | // Retrieve an existing value from the database. |
81 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
82 | - $screenname = ! empty( $instance['screenname'] ) ? $instance['screenname'] : ''; |
|
83 | - $zuid = ! empty( $instance['zuid'] ) ? $instance['zuid'] : ''; |
|
84 | - $format = ! empty( $instance['format'] ) ? $instance['format'] : 'format'; |
|
81 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
82 | + $screenname = ! empty($instance['screenname']) ? $instance['screenname'] : ''; |
|
83 | + $zuid = ! empty($instance['zuid']) ? $instance['zuid'] : ''; |
|
84 | + $format = ! empty($instance['format']) ? $instance['format'] : 'format'; |
|
85 | 85 | |
86 | 86 | // Title. |
87 | 87 | echo '<p>'; |
88 | - echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>'; |
|
89 | - echo ' <input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title . '" class="widefat">'; |
|
88 | + echo ' <label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>'; |
|
89 | + echo ' <input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">'; |
|
90 | 90 | echo '</p>'; |
91 | 91 | |
92 | 92 | // Zillow User ID. |
93 | 93 | echo '<p>'; |
94 | - echo ' <label for="' . $this->get_field_id( 'zuid' ) . '" class="title-label">' . __( 'Zillow User ID:', 're-pro' ) . '</label>'; |
|
95 | - echo ' <input id="' . $this->get_field_id( 'zuid' ) . '" name="' . $this->get_field_name( 'zuid' ) . '" value="' . $zuid . '" class="widefat">'; |
|
94 | + echo ' <label for="' . $this->get_field_id('zuid') . '" class="title-label">' . __('Zillow User ID:', 're-pro') . '</label>'; |
|
95 | + echo ' <input id="' . $this->get_field_id('zuid') . '" name="' . $this->get_field_name('zuid') . '" value="' . $zuid . '" class="widefat">'; |
|
96 | 96 | echo '</p>'; |
97 | 97 | |
98 | 98 | } |
@@ -105,12 +105,12 @@ discard block |
||
105 | 105 | * @param mixed $old_instance Old Instance. |
106 | 106 | * @return $instance |
107 | 107 | */ |
108 | - public function update( $new_instance, $old_instance ) { |
|
108 | + public function update($new_instance, $old_instance) { |
|
109 | 109 | |
110 | 110 | $instance = $old_instance; |
111 | 111 | |
112 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
113 | - $instance['zuid'] = ! empty( $new_instance['zuid'] ) ? strip_tags( $new_instance['zuid'] ) : ''; |
|
112 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
113 | + $instance['zuid'] = ! empty($new_instance['zuid']) ? strip_tags($new_instance['zuid']) : ''; |
|
114 | 114 | |
115 | 115 | return $instance; |
116 | 116 | } |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | |
23 | 23 | parent::__construct( |
24 | 24 | 'zillow-badges', |
25 | - __( 'Zillow Badge', 're-pro' ), |
|
25 | + __('Zillow Badge', 're-pro'), |
|
26 | 26 | array( |
27 | - 'description' => __( 'Display a Zillow Badge which links to an agent profile page.', 're-pro' ), |
|
27 | + 'description' => __('Display a Zillow Badge which links to an agent profile page.', 're-pro'), |
|
28 | 28 | 'classname' => 'widget widget-zillow-badge', |
29 | 29 | ) |
30 | 30 | ); |
@@ -43,9 +43,9 @@ discard block |
||
43 | 43 | /* Premier Agent. */ |
44 | 44 | array( |
45 | 45 | 'id' => 'premier-agent', |
46 | - 'name' => __( 'Zillow Premier Agent', 're-pro' ), |
|
47 | - 'alt' => __( 'Zillow Premier Agent', 're-pro' ), |
|
48 | - 'title' => __( 'Zillow Premier Agent', 're-pro' ), |
|
46 | + 'name' => __('Zillow Premier Agent', 're-pro'), |
|
47 | + 'alt' => __('Zillow Premier Agent', 're-pro'), |
|
48 | + 'title' => __('Zillow Premier Agent', 're-pro'), |
|
49 | 49 | 'class' => 'zillow-badge', |
50 | 50 | 'url' => 'https://www.zillowstatic.com/static/images/badges/premier-agent.png', |
51 | 51 | 'width' => 100, |
@@ -54,9 +54,9 @@ discard block |
||
54 | 54 | /* Featured .*/ |
55 | 55 | array( |
56 | 56 | 'id' => 'feature-badge-sm', |
57 | - 'name' => __( 'Featured on Zillow - Small', 're-pro' ), |
|
58 | - 'alt' => __( 'Featured on Zillow', 're-pro' ), |
|
59 | - 'title' => __( 'Featured on Zillow', 're-pro' ), |
|
57 | + 'name' => __('Featured on Zillow - Small', 're-pro'), |
|
58 | + 'alt' => __('Featured on Zillow', 're-pro'), |
|
59 | + 'title' => __('Featured on Zillow', 're-pro'), |
|
60 | 60 | 'class' => 'zillow-badge', |
61 | 61 | 'url' => 'https://www.zillowstatic.com/static/images/badges/feature_badge_sm.png', |
62 | 62 | 'width' => 100, |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | ), |
65 | 65 | array( |
66 | 66 | 'id' => 'feature-badge-lg', |
67 | - 'name' => __( 'Featured on Zillow - Large', 're-pro' ), |
|
68 | - 'alt' => __( 'Featured on Zillow', 're-pro' ), |
|
69 | - 'title' => __( 'Featured on Zillow', 're-pro' ), |
|
67 | + 'name' => __('Featured on Zillow - Large', 're-pro'), |
|
68 | + 'alt' => __('Featured on Zillow', 're-pro'), |
|
69 | + 'title' => __('Featured on Zillow', 're-pro'), |
|
70 | 70 | 'class' => 'zillow-badge', |
71 | 71 | 'url' => 'https://www.zillowstatic.com/static/images/badges/feature_badge_lg.png', |
72 | 72 | 'width' => 100, |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | /* View My Profile. */ |
76 | 76 | array( |
77 | 77 | 'id' => 'view-my-profile', |
78 | - 'name' => __( 'View my Profile', 're-pro' ), |
|
79 | - 'alt' => __( 'View my Profile', 're-pro' ), |
|
80 | - 'title' => __( 'View my Profile', 're-pro' ), |
|
78 | + 'name' => __('View my Profile', 're-pro'), |
|
79 | + 'alt' => __('View my Profile', 're-pro'), |
|
80 | + 'title' => __('View my Profile', 're-pro'), |
|
81 | 81 | 'class' => 'zillow-badge', |
82 | 82 | 'url' => 'https://www.zillowstatic.com/static/images/badges/bdg_profile.gif', |
83 | 83 | 'width' => 160, |
@@ -86,9 +86,9 @@ discard block |
||
86 | 86 | /* Feature My Listings - 160 x 40. */ |
87 | 87 | array( |
88 | 88 | 'id' => 'my-listing-bllg', |
89 | - 'name' => __( 'Feature My Listings 1', 're-pro' ), |
|
90 | - 'alt' => __( 'I feature my listings on Zillow', 're-pro' ), |
|
91 | - 'title' => __( 'I feature my listings on Zillow', 're-pro' ), |
|
89 | + 'name' => __('Feature My Listings 1', 're-pro'), |
|
90 | + 'alt' => __('I feature my listings on Zillow', 're-pro'), |
|
91 | + 'title' => __('I feature my listings on Zillow', 're-pro'), |
|
92 | 92 | 'class' => 'zillow-badge', |
93 | 93 | 'url' => 'https://www.zillowstatic.com/static/images/badges/zillow-my-listing_bllg.gif', |
94 | 94 | 'width' => 160, |
@@ -96,9 +96,9 @@ discard block |
||
96 | 96 | ), |
97 | 97 | array( |
98 | 98 | 'id' => 'my-listing-trlg', |
99 | - 'name' => __( 'Feature My Listings 2', 're-pro' ), |
|
100 | - 'alt' => __( 'I feature my listings on Zillow', 're-pro' ), |
|
101 | - 'title' => __( 'I feature my listings on Zillow', 're-pro' ), |
|
99 | + 'name' => __('Feature My Listings 2', 're-pro'), |
|
100 | + 'alt' => __('I feature my listings on Zillow', 're-pro'), |
|
101 | + 'title' => __('I feature my listings on Zillow', 're-pro'), |
|
102 | 102 | 'class' => 'zillow-badge', |
103 | 103 | 'url' => 'https://www.zillowstatic.com/static/images/badges/zillow-my-listing_trlg.gif', |
104 | 104 | 'width' => 160, |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | ), |
107 | 107 | array( |
108 | 108 | 'id' => 'my-listing-grlg', |
109 | - 'name' => __( 'Feature My Listings 3', 're-pro' ), |
|
110 | - 'alt' => __( 'I feature my listings on Zillow', 're-pro' ), |
|
111 | - 'title' => __( 'I feature my listings on Zillow', 're-pro' ), |
|
109 | + 'name' => __('Feature My Listings 3', 're-pro'), |
|
110 | + 'alt' => __('I feature my listings on Zillow', 're-pro'), |
|
111 | + 'title' => __('I feature my listings on Zillow', 're-pro'), |
|
112 | 112 | 'class' => 'zillow-badge', |
113 | 113 | 'url' => 'https://www.zillowstatic.com/static/images/badges/zillow-my-listing_grlg.gif', |
114 | 114 | 'width' => 160, |
@@ -117,9 +117,9 @@ discard block |
||
117 | 117 | /* ZILLOW ADDICT - 160 x 40 */ |
118 | 118 | array( |
119 | 119 | 'id' => 'addict-bllg', |
120 | - 'name' => __( 'Zillow Addict 1 (160X40)', 're-pro' ), |
|
121 | - 'alt' => __( 'Zillow Addict', 're-pro' ), |
|
122 | - 'title' => __( 'Zillow Addict', 're-pro' ), |
|
120 | + 'name' => __('Zillow Addict 1 (160X40)', 're-pro'), |
|
121 | + 'alt' => __('Zillow Addict', 're-pro'), |
|
122 | + 'title' => __('Zillow Addict', 're-pro'), |
|
123 | 123 | 'class' => 'zillow-badge', |
124 | 124 | 'url' => 'https://www.zillowstatic.com/static/images/badges/zillow-addict_bllg.gif', |
125 | 125 | 'width' => 160, |
@@ -127,9 +127,9 @@ discard block |
||
127 | 127 | ), |
128 | 128 | array( |
129 | 129 | 'id' => 'addict-trlg', |
130 | - 'name' => __( 'Zillow Addict 2 (160X40)', 're-pro' ), |
|
131 | - 'alt' => __( 'Zillow Addict', 're-pro' ), |
|
132 | - 'title' => __( 'Zillow Addict', 're-pro' ), |
|
130 | + 'name' => __('Zillow Addict 2 (160X40)', 're-pro'), |
|
131 | + 'alt' => __('Zillow Addict', 're-pro'), |
|
132 | + 'title' => __('Zillow Addict', 're-pro'), |
|
133 | 133 | 'class' => 'zillow-badge', |
134 | 134 | 'url' => 'https://www.zillowstatic.com/static/images/badges/zillow-addict_trlg.png', |
135 | 135 | 'width' => 160, |
@@ -137,9 +137,9 @@ discard block |
||
137 | 137 | ), |
138 | 138 | array( |
139 | 139 | 'id' => 'addict-grlg', |
140 | - 'name' => __( 'Zillow Addict 3 (160X40)', 're-pro' ), |
|
141 | - 'alt' => __( 'Zillow Addict', 're-pro' ), |
|
142 | - 'title' => __( 'Zillow Addict', 're-pro' ), |
|
140 | + 'name' => __('Zillow Addict 3 (160X40)', 're-pro'), |
|
141 | + 'alt' => __('Zillow Addict', 're-pro'), |
|
142 | + 'title' => __('Zillow Addict', 're-pro'), |
|
143 | 143 | 'class' => 'zillow-badge', |
144 | 144 | 'url' => 'https://www.zillowstatic.com/static/images/badges/zillow-addict_grlg.gif', |
145 | 145 | 'width' => 160, |
@@ -148,9 +148,9 @@ discard block |
||
148 | 148 | /* ZILLOW ADDICT - 100 x 40 */ |
149 | 149 | array( |
150 | 150 | 'id' => 'addict-blsm', |
151 | - 'name' => __( 'Zillow Addict 1 (100X40)', 're-pro' ), |
|
152 | - 'alt' => __( 'Zillow Addict', 're-pro' ), |
|
153 | - 'title' => __( 'Zillow Addict', 're-pro' ), |
|
151 | + 'name' => __('Zillow Addict 1 (100X40)', 're-pro'), |
|
152 | + 'alt' => __('Zillow Addict', 're-pro'), |
|
153 | + 'title' => __('Zillow Addict', 're-pro'), |
|
154 | 154 | 'class' => 'zillow-badge', |
155 | 155 | 'url' => 'https://www.zillowstatic.com/static/images/badges/zillow-addict_blsm.gif', |
156 | 156 | 'width' => 100, |
@@ -158,9 +158,9 @@ discard block |
||
158 | 158 | ), |
159 | 159 | array( |
160 | 160 | 'id' => 'addict-trsm', |
161 | - 'name' => __( 'Zillow Addict 2 (100X40)', 're-pro' ), |
|
162 | - 'alt' => __( 'Zillow Addict', 're-pro' ), |
|
163 | - 'title' => __( 'Zillow Addict', 're-pro' ), |
|
161 | + 'name' => __('Zillow Addict 2 (100X40)', 're-pro'), |
|
162 | + 'alt' => __('Zillow Addict', 're-pro'), |
|
163 | + 'title' => __('Zillow Addict', 're-pro'), |
|
164 | 164 | 'class' => 'zillow-badge', |
165 | 165 | 'url' => 'https://www.zillowstatic.com/static/images/badges/zillow-addict_trsm.png', |
166 | 166 | 'width' => 100, |
@@ -168,9 +168,9 @@ discard block |
||
168 | 168 | ), |
169 | 169 | array( |
170 | 170 | 'id' => 'addict-grsm', |
171 | - 'name' => __( 'Zillow Addict 3 (100X40)', 're-pro' ), |
|
172 | - 'alt' => __( 'Zillow Addict', 're-pro' ), |
|
173 | - 'title' => __( 'Zillow Addict', 're-pro' ), |
|
171 | + 'name' => __('Zillow Addict 3 (100X40)', 're-pro'), |
|
172 | + 'alt' => __('Zillow Addict', 're-pro'), |
|
173 | + 'title' => __('Zillow Addict', 're-pro'), |
|
174 | 174 | 'class' => 'zillow-badge', |
175 | 175 | 'url' => 'https://www.zillowstatic.com/static/images/badges/zillow-addict_grsm.gif', |
176 | 176 | 'width' => 100, |
@@ -179,9 +179,9 @@ discard block |
||
179 | 179 | /* REAL ESTATE FANATIC - 160 x 40 */ |
180 | 180 | array( |
181 | 181 | 'id' => 'fanatic-bllg', |
182 | - 'name' => __( 'Real Estate Fanatic 1 (160X40)', 're-pro' ), |
|
183 | - 'alt' => __( 'Real Estate Fanatic', 're-pro' ), |
|
184 | - 'title' => __( 'Real Estate Fanatic', 're-pro' ), |
|
182 | + 'name' => __('Real Estate Fanatic 1 (160X40)', 're-pro'), |
|
183 | + 'alt' => __('Real Estate Fanatic', 're-pro'), |
|
184 | + 'title' => __('Real Estate Fanatic', 're-pro'), |
|
185 | 185 | 'class' => 'zillow-badge', |
186 | 186 | 'url' => 'https://www.zillowstatic.com/static/images/badges/zillow-fanatic_bllg.gif', |
187 | 187 | 'width' => 160, |
@@ -189,9 +189,9 @@ discard block |
||
189 | 189 | ), |
190 | 190 | array( |
191 | 191 | 'id' => 'fanatic-trlg', |
192 | - 'name' => __( 'Real Estate Fanatic 2 (160X40)', 're-pro' ), |
|
193 | - 'alt' => __( 'Real Estate Fanatic', 're-pro' ), |
|
194 | - 'title' => __( 'Real Estate Fanatic', 're-pro' ), |
|
192 | + 'name' => __('Real Estate Fanatic 2 (160X40)', 're-pro'), |
|
193 | + 'alt' => __('Real Estate Fanatic', 're-pro'), |
|
194 | + 'title' => __('Real Estate Fanatic', 're-pro'), |
|
195 | 195 | 'class' => 'zillow-badge', |
196 | 196 | 'url' => 'https://www.zillowstatic.com/static/images/badges/zillow-fanatic_trlg.gif', |
197 | 197 | 'width' => 160, |
@@ -199,9 +199,9 @@ discard block |
||
199 | 199 | ), |
200 | 200 | array( |
201 | 201 | 'id' => 'fanatic-grlg', |
202 | - 'name' => __( 'Real Estate Fanatic 3 (160X40)', 're-pro' ), |
|
203 | - 'alt' => __( 'Real Estate Fanatic', 're-pro' ), |
|
204 | - 'title' => __( 'Real Estate Fanatic', 're-pro' ), |
|
202 | + 'name' => __('Real Estate Fanatic 3 (160X40)', 're-pro'), |
|
203 | + 'alt' => __('Real Estate Fanatic', 're-pro'), |
|
204 | + 'title' => __('Real Estate Fanatic', 're-pro'), |
|
205 | 205 | 'class' => 'zillow-badge', |
206 | 206 | 'url' => 'https://www.zillowstatic.com/static/images/badges/zillow-fanatic_grlg.gif', |
207 | 207 | 'width' => 160, |
@@ -210,9 +210,9 @@ discard block |
||
210 | 210 | /* REAL ESTATE FANATIC - 120X40 */ |
211 | 211 | array( |
212 | 212 | 'id' => 'fanatic-blsm', |
213 | - 'name' => __( 'Real Estate Fanatic 1 (120X40)', 're-pro' ), |
|
214 | - 'alt' => __( 'Real Estate Fanatic', 're-pro' ), |
|
215 | - 'title' => __( 'Real Estate Fanatic', 're-pro' ), |
|
213 | + 'name' => __('Real Estate Fanatic 1 (120X40)', 're-pro'), |
|
214 | + 'alt' => __('Real Estate Fanatic', 're-pro'), |
|
215 | + 'title' => __('Real Estate Fanatic', 're-pro'), |
|
216 | 216 | 'class' => 'zillow-badge', |
217 | 217 | 'url' => 'https://www.zillowstatic.com/static/images/badges/zillow-fanatic_blsm.gif', |
218 | 218 | 'width' => 120, |
@@ -220,9 +220,9 @@ discard block |
||
220 | 220 | ), |
221 | 221 | array( |
222 | 222 | 'id' => 'fanatic-trsm', |
223 | - 'name' => __( 'Real Estate Fanatic 2 (120X40)', 're-pro' ), |
|
224 | - 'alt' => __( 'Real Estate Fanatic', 're-pro' ), |
|
225 | - 'title' => __( 'Real Estate Fanatic', 're-pro' ), |
|
223 | + 'name' => __('Real Estate Fanatic 2 (120X40)', 're-pro'), |
|
224 | + 'alt' => __('Real Estate Fanatic', 're-pro'), |
|
225 | + 'title' => __('Real Estate Fanatic', 're-pro'), |
|
226 | 226 | 'class' => 'zillow-badge', |
227 | 227 | 'url' => 'https://www.zillowstatic.com/static/images/badges/zillow-fanatic_trsm.gif', |
228 | 228 | 'width' => 120, |
@@ -230,9 +230,9 @@ discard block |
||
230 | 230 | ), |
231 | 231 | array( |
232 | 232 | 'id' => 'fanatic-grsm', |
233 | - 'name' => __( 'Real Estate Fanatic 3 (120X40)', 're-pro' ), |
|
234 | - 'alt' => __( 'Real Estate Fanatic', 're-pro' ), |
|
235 | - 'title' => __( 'Real Estate Fanatic', 're-pro' ), |
|
233 | + 'name' => __('Real Estate Fanatic 3 (120X40)', 're-pro'), |
|
234 | + 'alt' => __('Real Estate Fanatic', 're-pro'), |
|
235 | + 'title' => __('Real Estate Fanatic', 're-pro'), |
|
236 | 236 | 'class' => 'zillow-badge', |
237 | 237 | 'url' => 'https://www.zillowstatic.com/static/images/badges/zillow-fanatic_grsm.gif', |
238 | 238 | 'width' => 120, |
@@ -241,9 +241,9 @@ discard block |
||
241 | 241 | /* Dig Influencer */ |
242 | 242 | array( |
243 | 243 | 'id' => 'dig-square-influencer', |
244 | - 'name' => __( 'Dig Influencer Square', 're-pro' ), |
|
245 | - 'alt' => __( 'Dig Influencer', 're-pro' ), |
|
246 | - 'title' => __( 'Dig Influencer', 're-pro' ), |
|
244 | + 'name' => __('Dig Influencer Square', 're-pro'), |
|
245 | + 'alt' => __('Dig Influencer', 're-pro'), |
|
246 | + 'title' => __('Dig Influencer', 're-pro'), |
|
247 | 247 | 'class' => 'zillow-badge', |
248 | 248 | 'url' => 'https://www.zillowstatic.com/static/images/badges/square-influencer.png', |
249 | 249 | 'width' => 72, |
@@ -251,9 +251,9 @@ discard block |
||
251 | 251 | ), |
252 | 252 | array( |
253 | 253 | 'id' => 'dig-rectangle-influencer', |
254 | - 'name' => __( 'Dig Rectangle Influencer', 're-pro' ), |
|
255 | - 'alt' => __( 'Dig Influencer', 're-pro' ), |
|
256 | - 'title' => __( 'Dig Influencer', 're-pro' ), |
|
254 | + 'name' => __('Dig Rectangle Influencer', 're-pro'), |
|
255 | + 'alt' => __('Dig Influencer', 're-pro'), |
|
256 | + 'title' => __('Dig Influencer', 're-pro'), |
|
257 | 257 | 'class' => 'zillow-badge', |
258 | 258 | 'url' => 'https://www.zillowstatic.com/static/images/badges/rectangle-influencer.png', |
259 | 259 | 'width' => 109, |
@@ -261,9 +261,9 @@ discard block |
||
261 | 261 | ), |
262 | 262 | array( |
263 | 263 | 'id' => 'dig-square-pro', |
264 | - 'name' => __( 'Dig Square Pro', 're-pro' ), |
|
265 | - 'alt' => __( 'Dig Influencer', 're-pro' ), |
|
266 | - 'title' => __( 'Dig Influencer', 're-pro' ), |
|
264 | + 'name' => __('Dig Square Pro', 're-pro'), |
|
265 | + 'alt' => __('Dig Influencer', 're-pro'), |
|
266 | + 'title' => __('Dig Influencer', 're-pro'), |
|
267 | 267 | 'class' => 'zillow-badge', |
268 | 268 | 'url' => 'https://www.zillowstatic.com/static/images/badges/square-pro.png', |
269 | 269 | 'width' => 72, |
@@ -271,9 +271,9 @@ discard block |
||
271 | 271 | ), |
272 | 272 | array( |
273 | 273 | 'id' => 'dig-rectangle-pro', |
274 | - 'name' => __( 'Dig Rectangle Pro', 're-pro' ), |
|
275 | - 'alt' => __( 'Dig Influencer', 're-pro' ), |
|
276 | - 'title' => __( 'Dig Influencer', 're-pro' ), |
|
274 | + 'name' => __('Dig Rectangle Pro', 're-pro'), |
|
275 | + 'alt' => __('Dig Influencer', 're-pro'), |
|
276 | + 'title' => __('Dig Influencer', 're-pro'), |
|
277 | 277 | 'class' => 'zillow-badge', |
278 | 278 | 'url' => 'https://www.zillowstatic.com/static/images/badges/rectangle-pro.png', |
279 | 279 | 'width' => 109, |
@@ -291,24 +291,24 @@ discard block |
||
291 | 291 | * @param mixed $instance Instance. |
292 | 292 | * @return void |
293 | 293 | */ |
294 | - public function widget( $args, $instance ) { |
|
294 | + public function widget($args, $instance) { |
|
295 | 295 | |
296 | 296 | // Retrieve any existing value from the database. |
297 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
298 | - $zid = ! empty( $instance['zid'] ) ? $instance['zid'] : ''; |
|
299 | - $badge_name = ! empty( $instance['badge_name'] ) ? $instance['badge_name'] : ''; |
|
300 | - $badge_alignment = ! empty( $instance['badge_alignment'] ) ? $instance['badge_alignment'] : ''; |
|
297 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
298 | + $zid = ! empty($instance['zid']) ? $instance['zid'] : ''; |
|
299 | + $badge_name = ! empty($instance['badge_name']) ? $instance['badge_name'] : ''; |
|
300 | + $badge_alignment = ! empty($instance['badge_alignment']) ? $instance['badge_alignment'] : ''; |
|
301 | 301 | |
302 | 302 | $zillow_badges = $this->zillow_badges(); |
303 | 303 | |
304 | 304 | echo $args['before_widget']; |
305 | 305 | |
306 | - echo $args['before_title'] . esc_attr( $title ) . $args['after_title'] ; |
|
306 | + echo $args['before_title'] . esc_attr($title) . $args['after_title']; |
|
307 | 307 | |
308 | - foreach ( $zillow_badges as $zillow_badge ) { |
|
309 | - if ( $badge_name === $zillow_badge['id'] ) { |
|
308 | + foreach ($zillow_badges as $zillow_badge) { |
|
309 | + if ($badge_name === $zillow_badge['id']) { |
|
310 | 310 | |
311 | - echo '<a href="https://www.zillow.com/profile/'. $zid .'" ><img id="zillow-'. esc_attr( $zillow_badge['id'] ) .'-badge" class="'. sanitize_html_class( $zillow_badge['class'] ) . ' ' . sanitize_html_class( $badge_alignment ) .'" src="' . esc_url( apply_filters( 'jetpack_photon_url', $zillow_badge['url'] ) ) . '" alt="'. esc_attr( $zillow_badge['alt'] ) . '" height="'. esc_attr( $zillow_badge['height'] ) .'" width="'. esc_attr( $zillow_badge['width'] ) .'" title="'. esc_attr( $zillow_badge['alt'] ) .'" /></a>'; |
|
311 | + echo '<a href="https://www.zillow.com/profile/' . $zid . '" ><img id="zillow-' . esc_attr($zillow_badge['id']) . '-badge" class="' . sanitize_html_class($zillow_badge['class']) . ' ' . sanitize_html_class($badge_alignment) . '" src="' . esc_url(apply_filters('jetpack_photon_url', $zillow_badge['url'])) . '" alt="' . esc_attr($zillow_badge['alt']) . '" height="' . esc_attr($zillow_badge['height']) . '" width="' . esc_attr($zillow_badge['width']) . '" title="' . esc_attr($zillow_badge['alt']) . '" /></a>'; |
|
312 | 312 | |
313 | 313 | } |
314 | 314 | } |
@@ -324,10 +324,10 @@ discard block |
||
324 | 324 | * @param mixed $instance Instance. |
325 | 325 | * @return void |
326 | 326 | */ |
327 | - public function form( $instance ) { |
|
327 | + public function form($instance) { |
|
328 | 328 | |
329 | 329 | // Set default values. |
330 | - $instance = wp_parse_args( (array) $instance, array( |
|
330 | + $instance = wp_parse_args((array) $instance, array( |
|
331 | 331 | 'title' => '', |
332 | 332 | 'zid' => '', |
333 | 333 | 'badge_name' => '', |
@@ -335,46 +335,46 @@ discard block |
||
335 | 335 | )); |
336 | 336 | |
337 | 337 | // Retrieve an existing value from the database. |
338 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
339 | - $zid = ! empty( $instance['zid'] ) ? $instance['zid'] : ''; |
|
340 | - $badge_name = ! empty( $instance['badge_name'] ) ? $instance['badge_name'] : ''; |
|
341 | - $badge_alignment = ! empty( $instance['badge_alignment'] ) ? $instance['badge_alignment'] : ''; |
|
338 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
339 | + $zid = ! empty($instance['zid']) ? $instance['zid'] : ''; |
|
340 | + $badge_name = ! empty($instance['badge_name']) ? $instance['badge_name'] : ''; |
|
341 | + $badge_alignment = ! empty($instance['badge_alignment']) ? $instance['badge_alignment'] : ''; |
|
342 | 342 | |
343 | 343 | $zillow_badges = $this->zillow_badges(); |
344 | 344 | |
345 | 345 | // Form fields. |
346 | 346 | echo '<p>'; |
347 | - echo ' <label for="' . esc_attr( $this->get_field_id( 'title' ) ) . '" class="title_label">' . esc_attr( 'Title', 're-pro' ) . '</label>'; |
|
348 | - echo ' <input type="text" id="' . esc_attr( $this->get_field_id( 'title' ) ) . '" name="' . esc_attr( $this->get_field_name( 'title' ) ) . '" class="widefat" placeholder="' . esc_attr__( 'Find me on Zillow', 're-pro' ) . '" value="' . esc_attr( $title ) . '">'; |
|
349 | - echo ' <span class="description">' . esc_attr( 'Add a title to your zillow badge.', 're-pro' ) . '</span>'; |
|
347 | + echo ' <label for="' . esc_attr($this->get_field_id('title')) . '" class="title_label">' . esc_attr('Title', 're-pro') . '</label>'; |
|
348 | + echo ' <input type="text" id="' . esc_attr($this->get_field_id('title')) . '" name="' . esc_attr($this->get_field_name('title')) . '" class="widefat" placeholder="' . esc_attr__('Find me on Zillow', 're-pro') . '" value="' . esc_attr($title) . '">'; |
|
349 | + echo ' <span class="description">' . esc_attr('Add a title to your zillow badge.', 're-pro') . '</span>'; |
|
350 | 350 | echo '</p>'; |
351 | 351 | |
352 | 352 | echo '<p>'; |
353 | - echo ' <label for="' . esc_attr( $this->get_field_id( 'zid' ) ) . '" class="zid_label">' . esc_attr( 'Zillow User ID', 're-pro' ) . '</label>'; |
|
354 | - echo ' <input type="text" id="' . esc_attr( $this->get_field_id( 'zid' ) ) . '" name="' . esc_attr( $this->get_field_name( 'zid' ) ) . '" class="widefat" placeholder="' . esc_attr__( 'ZID', 're-pro' ) . '" value="' . esc_attr( $zid ) . '">'; |
|
355 | - echo ' <span class="description">' . esc_attr( 'Please provide your Zillow User ID.', 're-pro' ) . '</span>'; |
|
353 | + echo ' <label for="' . esc_attr($this->get_field_id('zid')) . '" class="zid_label">' . esc_attr('Zillow User ID', 're-pro') . '</label>'; |
|
354 | + echo ' <input type="text" id="' . esc_attr($this->get_field_id('zid')) . '" name="' . esc_attr($this->get_field_name('zid')) . '" class="widefat" placeholder="' . esc_attr__('ZID', 're-pro') . '" value="' . esc_attr($zid) . '">'; |
|
355 | + echo ' <span class="description">' . esc_attr('Please provide your Zillow User ID.', 're-pro') . '</span>'; |
|
356 | 356 | echo '</p>'; |
357 | 357 | |
358 | 358 | echo '<p>'; |
359 | - echo ' <label for="' . esc_attr( $this->get_field_id( 'badge_name' ) ) . '" class="badge_name_label">' . esc_attr( 'Badge Type', 're-pro' ) . '</label><br />'; |
|
360 | - echo ' <select id="' . esc_attr( $this->get_field_id( 'badge_name' ) ) . '" name="' . esc_attr( $this->get_field_name( 'badge_name' ) ) . '" class="widefat">'; |
|
361 | - echo ' <option value="" '. selected( $badge_name, '', false ) .'>'. esc_attr( 'Choose', 're-pro' ) .'</option>'; |
|
362 | - foreach ( $zillow_badges as $zillow_badge ) { |
|
363 | - echo '<option value="'. esc_attr( $zillow_badge['id'] ) .'" ' . selected( $badge_name, $zillow_badge['id'], false ) . '> ' . esc_attr( $zillow_badge['name'] ) . '</option>'; |
|
359 | + echo ' <label for="' . esc_attr($this->get_field_id('badge_name')) . '" class="badge_name_label">' . esc_attr('Badge Type', 're-pro') . '</label><br />'; |
|
360 | + echo ' <select id="' . esc_attr($this->get_field_id('badge_name')) . '" name="' . esc_attr($this->get_field_name('badge_name')) . '" class="widefat">'; |
|
361 | + echo ' <option value="" ' . selected($badge_name, '', false) . '>' . esc_attr('Choose', 're-pro') . '</option>'; |
|
362 | + foreach ($zillow_badges as $zillow_badge) { |
|
363 | + echo '<option value="' . esc_attr($zillow_badge['id']) . '" ' . selected($badge_name, $zillow_badge['id'], false) . '> ' . esc_attr($zillow_badge['name']) . '</option>'; |
|
364 | 364 | } |
365 | 365 | |
366 | 366 | echo '</select>'; |
367 | - echo '<span class="description">' . __( 'Choose a badge type from the dropdown. Click Save to preview the badge. Full list of badges can be found on <a href="http://www.zillow.com/webtools/badges/" target="_blank" rel="nofollow">Zillow</a>.', 're-pro' ) . '</span>'; |
|
367 | + echo '<span class="description">' . __('Choose a badge type from the dropdown. Click Save to preview the badge. Full list of badges can be found on <a href="http://www.zillow.com/webtools/badges/" target="_blank" rel="nofollow">Zillow</a>.', 're-pro') . '</span>'; |
|
368 | 368 | echo '</p>'; |
369 | 369 | |
370 | 370 | echo '<p>'; |
371 | - echo ' <label for="' . esc_attr( $this->get_field_id( 'badge_alignment' ) ) . '" class="badge_alignment_label">' . esc_attr_e( 'Badge Alignment', 're-pro' ) . '</label>'; |
|
372 | - echo ' <select id="' . esc_attr( $this->get_field_id( 'badge_alignment' ) ) . '" name="' . esc_attr( $this->get_field_name( 'badge_alignment' ) ) . '" class="widefat">'; |
|
373 | - echo ' <option value="alignleft" ' . selected( $badge_alignment, 'alignleft', false ) . '> ' . esc_attr( 'Left', 're-pro' ) . '</option>'; |
|
374 | - echo ' <option value="aligncenter" ' . selected( $badge_alignment, 'aligncenter', false ) . '> ' . esc_attr( 'Center', 're-pro' ) . '</option>'; |
|
375 | - echo ' <option value="alignright" ' . selected( $badge_alignment, 'alignright', false ) . '> ' . esc_attr( 'Right', 're-pro' ) . '</option>'; |
|
371 | + echo ' <label for="' . esc_attr($this->get_field_id('badge_alignment')) . '" class="badge_alignment_label">' . esc_attr_e('Badge Alignment', 're-pro') . '</label>'; |
|
372 | + echo ' <select id="' . esc_attr($this->get_field_id('badge_alignment')) . '" name="' . esc_attr($this->get_field_name('badge_alignment')) . '" class="widefat">'; |
|
373 | + echo ' <option value="alignleft" ' . selected($badge_alignment, 'alignleft', false) . '> ' . esc_attr('Left', 're-pro') . '</option>'; |
|
374 | + echo ' <option value="aligncenter" ' . selected($badge_alignment, 'aligncenter', false) . '> ' . esc_attr('Center', 're-pro') . '</option>'; |
|
375 | + echo ' <option value="alignright" ' . selected($badge_alignment, 'alignright', false) . '> ' . esc_attr('Right', 're-pro') . '</option>'; |
|
376 | 376 | echo ' </select>'; |
377 | - echo ' <span class="description">' . esc_attr( 'Choose how to align your badge within the widget space.', 're-pro' ) . '</span>'; |
|
377 | + echo ' <span class="description">' . esc_attr('Choose how to align your badge within the widget space.', 're-pro') . '</span>'; |
|
378 | 378 | echo '</p>'; |
379 | 379 | |
380 | 380 | } |
@@ -387,15 +387,15 @@ discard block |
||
387 | 387 | * @param mixed $old_instance Old Instance. |
388 | 388 | * @return $instance Instance. |
389 | 389 | */ |
390 | - public function update( $new_instance, $old_instance ) { |
|
390 | + public function update($new_instance, $old_instance) { |
|
391 | 391 | |
392 | 392 | $instance = $old_instance; |
393 | 393 | |
394 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
395 | - $instance['badge_name'] = ! empty( $new_instance['badge_name'] ) ? strip_tags( $new_instance['badge_name'] ) : ''; |
|
396 | - $instance['badge_alignment'] = ! empty( $new_instance['badge_alignment'] ) ? strip_tags( $new_instance['badge_alignment'] ) : ''; |
|
394 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
395 | + $instance['badge_name'] = ! empty($new_instance['badge_name']) ? strip_tags($new_instance['badge_name']) : ''; |
|
396 | + $instance['badge_alignment'] = ! empty($new_instance['badge_alignment']) ? strip_tags($new_instance['badge_alignment']) : ''; |
|
397 | 397 | |
398 | - $instance['zid'] = ! empty( $new_instance['zid'] ) ? strip_tags( $new_instance['zid'] ) : ''; |
|
398 | + $instance['zid'] = ! empty($new_instance['zid']) ? strip_tags($new_instance['zid']) : ''; |
|
399 | 399 | |
400 | 400 | return $instance; |
401 | 401 | |
@@ -410,6 +410,6 @@ discard block |
||
410 | 410 | */ |
411 | 411 | function register_zillow_badge_widgets() { |
412 | 412 | |
413 | - register_widget( 'Zillow_Badges' ); |
|
413 | + register_widget('Zillow_Badges'); |
|
414 | 414 | } |
415 | -add_action( 'widgets_init', 'register_zillow_badge_widgets' ); |
|
415 | +add_action('widgets_init', 'register_zillow_badge_widgets'); |
@@ -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 Monthly Payment Calculator Widget (https://www.zillow.com/webtools/widgets/monthly-payment-calculator-widget/) |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | |
28 | 28 | parent::__construct( |
29 | 29 | 'zillow_monthly_paycalc_widget', |
30 | - __( 'Zillow Monthly Payment Calculator', 're-pro' ), |
|
30 | + __('Zillow Monthly Payment Calculator', 're-pro'), |
|
31 | 31 | array( |
32 | - 'description' => __( 'Display a Monthly Payment Calculator from Zillow.', 're-pro' ), |
|
32 | + 'description' => __('Display a Monthly Payment Calculator from Zillow.', 're-pro'), |
|
33 | 33 | 'classname' => 're-pro re-pro-widget zillow-widget zillow-widget-monthly-payment-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_monthlypay_calc_widget( $iframe_id ); |
|
58 | + return $zillow_widgets->get_monthlypay_calc_widget($iframe_id); |
|
59 | 59 | |
60 | 60 | echo $args['after_widget']; |
61 | 61 | } |
@@ -67,10 +67,10 @@ discard block |
||
67 | 67 | * @param mixed $instance Instance. |
68 | 68 | * @return void |
69 | 69 | */ |
70 | - public function form( $instance ) { |
|
70 | + public function form($instance) { |
|
71 | 71 | |
72 | 72 | // Set default values. |
73 | - $instance = wp_parse_args( (array) $instance, array( |
|
73 | + $instance = wp_parse_args((array) $instance, array( |
|
74 | 74 | 'title' => '', |
75 | 75 | 'screenname' => '', |
76 | 76 | 'region' => '', |
@@ -79,12 +79,12 @@ discard block |
||
79 | 79 | )); |
80 | 80 | |
81 | 81 | // Retrieve an existing value from the database. |
82 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
82 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
83 | 83 | |
84 | 84 | // Title. |
85 | 85 | echo '<p>'; |
86 | - echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>'; |
|
87 | - echo ' <input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title . '" class="widefat">'; |
|
86 | + echo ' <label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>'; |
|
87 | + echo ' <input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">'; |
|
88 | 88 | echo '</p>'; |
89 | 89 | |
90 | 90 | } |
@@ -97,11 +97,11 @@ discard block |
||
97 | 97 | * @param mixed $old_instance Old Instance. |
98 | 98 | * @return $instance |
99 | 99 | */ |
100 | - public function update( $new_instance, $old_instance ) { |
|
100 | + public function update($new_instance, $old_instance) { |
|
101 | 101 | |
102 | 102 | $instance = $old_instance; |
103 | 103 | |
104 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
104 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
105 | 105 | |
106 | 106 | return $instance; |
107 | 107 | } |
@@ -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,30 +6,30 @@ |
||
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 | |
13 | 13 | // Google maps. |
14 | -include_once( 'modules/google-maps/gmaps.php' ); |
|
14 | +include_once('modules/google-maps/gmaps.php'); |
|
15 | 15 | |
16 | 16 | // Equal Housing. |
17 | -include_once( 'modules/equal-housing/equal-housing.php' ); |
|
17 | +include_once('modules/equal-housing/equal-housing.php'); |
|
18 | 18 | |
19 | 19 | // Zillow. |
20 | -include_once( 'modules/zillow/zillow.php' ); |
|
20 | +include_once('modules/zillow/zillow.php'); |
|
21 | 21 | |
22 | -include_once( 'modules/trulia/trulia.php' ); |
|
22 | +include_once('modules/trulia/trulia.php'); |
|
23 | 23 | |
24 | -include_once( 'modules/inman/inman.php' ); |
|
24 | +include_once('modules/inman/inman.php'); |
|
25 | 25 | |
26 | -include_once( 'modules/homes-com/homes-com.php' ); |
|
26 | +include_once('modules/homes-com/homes-com.php'); |
|
27 | 27 | |
28 | 28 | |
29 | -include_once( 'modules/streetadvisor/streetadvisor.php' ); |
|
29 | +include_once('modules/streetadvisor/streetadvisor.php'); |
|
30 | 30 | |
31 | -include_once( 'modules/greatschools/greatschools.php' ); |
|
31 | +include_once('modules/greatschools/greatschools.php'); |
|
32 | 32 | |
33 | -include_once( 'modules/homefinder/homefinder.php' ); |
|
33 | +include_once('modules/homefinder/homefinder.php'); |
|
34 | 34 | |
35 | -include_once( 'modules/rentbits/rentbits.php' ); |
|
35 | +include_once('modules/rentbits/rentbits.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'); |