@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /* Exit if accessed directly. */ |
4 | -if ( ! defined( 'ABSPATH' ) ) { exit; } |
|
4 | +if ( ! defined('ABSPATH')) { exit; } |
|
5 | 5 | |
6 | 6 | /** |
7 | 7 | * Zillow Large Search Box Widget (http://www.zillow.com/webtools/widgets/ZillowLargeSearchBox.htm) |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | |
28 | 28 | parent::__construct( |
29 | 29 | 'zillow_large_search_box', |
30 | - __( 'Zillow Large Search Box', 're-pro' ), |
|
30 | + __('Zillow Large Search Box', 're-pro'), |
|
31 | 31 | array( |
32 | - 'description' => __( 'Display a Large Search Box from Zillow.', 're-pro' ), |
|
32 | + 'description' => __('Display a Large Search Box from Zillow.', 're-pro'), |
|
33 | 33 | 'classname' => 're-pro re-pro-widget zillow-widget zillow-widget-search-box', |
34 | 34 | 'customize_selective_refresh' => true, |
35 | 35 | ) |
@@ -44,24 +44,24 @@ discard block |
||
44 | 44 | * @param mixed $instance Instance. |
45 | 45 | * @return void |
46 | 46 | */ |
47 | - public function widget( $args, $instance ) { |
|
47 | + public function widget($args, $instance) { |
|
48 | 48 | |
49 | - $iframe_id = ! empty( $args['widget_id'] ) ? $args['widget_id'] : ''; |
|
50 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
51 | - $type = ! empty( $instance['type'] ) ? $instance['type'] : ''; |
|
52 | - $screenname = ! empty( $instance['screenname'] ) ? $instance['screenname'] : ''; |
|
53 | - $location = ! empty( $instance['location'] ) ? $instance['location'] : ''; |
|
54 | - $home_val_info = ! empty( $instance['home_val_info'] ) ? $instance['home_val_info'] : ''; |
|
55 | - $home_val_info = ( $home_val_info ) ? 'no' : 'yes'; |
|
49 | + $iframe_id = ! empty($args['widget_id']) ? $args['widget_id'] : ''; |
|
50 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
51 | + $type = ! empty($instance['type']) ? $instance['type'] : ''; |
|
52 | + $screenname = ! empty($instance['screenname']) ? $instance['screenname'] : ''; |
|
53 | + $location = ! empty($instance['location']) ? $instance['location'] : ''; |
|
54 | + $home_val_info = ! empty($instance['home_val_info']) ? $instance['home_val_info'] : ''; |
|
55 | + $home_val_info = ($home_val_info) ? 'no' : 'yes'; |
|
56 | 56 | |
57 | 57 | |
58 | 58 | echo $args['before_widget']; |
59 | 59 | |
60 | - echo $args['before_title'] . esc_attr( $title ) . $args['after_title']; |
|
60 | + echo $args['before_title'] . esc_attr($title) . $args['after_title']; |
|
61 | 61 | |
62 | 62 | $zillow_widgets = new ZillowWidgets(); |
63 | 63 | |
64 | - $zillow_widgets->get_lg_zillow_search_widget( $iframe_id, $screenname, 'iframe', $location, $home_val_info ); |
|
64 | + $zillow_widgets->get_lg_zillow_search_widget($iframe_id, $screenname, 'iframe', $location, $home_val_info); |
|
65 | 65 | |
66 | 66 | echo $args['after_widget']; |
67 | 67 | } |
@@ -73,10 +73,10 @@ discard block |
||
73 | 73 | * @param mixed $instance Instance. |
74 | 74 | * @return void |
75 | 75 | */ |
76 | - public function form( $instance ) { |
|
76 | + public function form($instance) { |
|
77 | 77 | |
78 | 78 | // Set default values. |
79 | - $instance = wp_parse_args( (array) $instance, array( |
|
79 | + $instance = wp_parse_args((array) $instance, array( |
|
80 | 80 | 'title' => '', |
81 | 81 | 'type' => 'iframe', |
82 | 82 | 'screenname' => '', |
@@ -85,34 +85,34 @@ discard block |
||
85 | 85 | )); |
86 | 86 | |
87 | 87 | // Retrieve an existing value from the database. |
88 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
89 | - $screenname = ! empty( $instance['screenname'] ) ? $instance['screenname'] : ''; |
|
90 | - $location = ! empty( $instance['location'] ) ? $instance['location'] : ''; |
|
91 | - $home_val_info = ! empty( $instance['home_val_info'] ) ? $instance['home_val_info'] : 0; |
|
88 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
89 | + $screenname = ! empty($instance['screenname']) ? $instance['screenname'] : ''; |
|
90 | + $location = ! empty($instance['location']) ? $instance['location'] : ''; |
|
91 | + $home_val_info = ! empty($instance['home_val_info']) ? $instance['home_val_info'] : 0; |
|
92 | 92 | |
93 | 93 | |
94 | 94 | // Title. |
95 | 95 | echo '<p>'; |
96 | - echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>'; |
|
97 | - echo ' <input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title . '" class="widefat">'; |
|
96 | + echo ' <label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>'; |
|
97 | + echo ' <input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">'; |
|
98 | 98 | echo '</p>'; |
99 | 99 | |
100 | 100 | // Zillow Screenname. |
101 | 101 | echo '<p>'; |
102 | - echo ' <label for="' . $this->get_field_id( 'screenname' ) . '" class="title-label">' . __( 'Zillow Screenname:', 're-pro' ) . '</label>'; |
|
103 | - echo ' <input id="' . $this->get_field_id( 'screenname' ) . '" name="' . $this->get_field_name( 'screenname' ) . '" value="' . $screenname . '" class="widefat">'; |
|
102 | + echo ' <label for="' . $this->get_field_id('screenname') . '" class="title-label">' . __('Zillow Screenname:', 're-pro') . '</label>'; |
|
103 | + echo ' <input id="' . $this->get_field_id('screenname') . '" name="' . $this->get_field_name('screenname') . '" value="' . $screenname . '" class="widefat">'; |
|
104 | 104 | echo '</p>'; |
105 | 105 | |
106 | 106 | // Location. |
107 | 107 | echo '<p>'; |
108 | - echo ' <label for="' . $this->get_field_id( 'location' ) . '" class="title-label">' . __( 'Location:', 're-pro' ) . '</label>'; |
|
109 | - echo ' <input id="' . $this->get_field_id( 'location' ) . '" placeholder="El Segundo, CA" name="' . $this->get_field_name( 'location' ) . '" value="' . $location . '" class="widefat">'; |
|
108 | + echo ' <label for="' . $this->get_field_id('location') . '" class="title-label">' . __('Location:', 're-pro') . '</label>'; |
|
109 | + echo ' <input id="' . $this->get_field_id('location') . '" placeholder="El Segundo, CA" name="' . $this->get_field_name('location') . '" value="' . $location . '" class="widefat">'; |
|
110 | 110 | echo '</p>'; |
111 | 111 | |
112 | 112 | // Home Value Info |
113 | 113 | echo '<p>'; |
114 | - echo '<input value="1" type="checkbox"' . checked( esc_attr( $home_val_info ), 1, false ) . 'id="' . esc_attr( $this->get_field_id( 'home_val_info' ) ) . '" name="' . esc_attr( $this->get_field_name( 'home_val_info' ) ) . '" />'; |
|
115 | - echo '<label for="' . $this->get_field_id( 'home_val_info' ) . '">Hide home value information</label>'; |
|
114 | + echo '<input value="1" type="checkbox"' . checked(esc_attr($home_val_info), 1, false) . 'id="' . esc_attr($this->get_field_id('home_val_info')) . '" name="' . esc_attr($this->get_field_name('home_val_info')) . '" />'; |
|
115 | + echo '<label for="' . $this->get_field_id('home_val_info') . '">Hide home value information</label>'; |
|
116 | 116 | echo '</p>'; |
117 | 117 | |
118 | 118 | |
@@ -126,14 +126,14 @@ discard block |
||
126 | 126 | * @param mixed $old_instance Old Instance. |
127 | 127 | * @return $instance |
128 | 128 | */ |
129 | - public function update( $new_instance, $old_instance ) { |
|
129 | + public function update($new_instance, $old_instance) { |
|
130 | 130 | |
131 | 131 | $instance = $old_instance; |
132 | 132 | |
133 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
134 | - $instance['screenname'] = ! empty( $new_instance['screenname'] ) ? strip_tags( $new_instance['screenname'] ) : ''; |
|
135 | - $instance['location'] = ! empty( $new_instance['location'] ) ? strip_tags( $new_instance['location'] ) : ''; |
|
136 | - $instance['home_val_info'] = ! empty( $new_instance['home_val_info'] ) ? strip_tags( $new_instance['home_val_info'] ) : 0; |
|
133 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
134 | + $instance['screenname'] = ! empty($new_instance['screenname']) ? strip_tags($new_instance['screenname']) : ''; |
|
135 | + $instance['location'] = ! empty($new_instance['location']) ? strip_tags($new_instance['location']) : ''; |
|
136 | + $instance['home_val_info'] = ! empty($new_instance['home_val_info']) ? strip_tags($new_instance['home_val_info']) : 0; |
|
137 | 137 | |
138 | 138 | |
139 | 139 | return $instance; |
@@ -148,6 +148,6 @@ discard block |
||
148 | 148 | */ |
149 | 149 | function repro_zillow_search_box_widget() { |
150 | 150 | |
151 | - register_widget( 'ZillowLargeSearchBox' ); |
|
151 | + register_widget('ZillowLargeSearchBox'); |
|
152 | 152 | } |
153 | -add_action( 'widgets_init', 'repro_zillow_search_box_widget' ); |
|
153 | +add_action('widgets_init', 'repro_zillow_search_box_widget'); |
@@ -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 Listings Widget (https://www.zillow.com/webtools/widgets/MyListingsWidget.htm) |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | |
28 | 28 | parent::__construct( |
29 | 29 | 'zillow_listings_widget', |
30 | - __( 'Zillow Listings', 're-pro' ), |
|
30 | + __('Zillow Listings', 're-pro'), |
|
31 | 31 | array( |
32 | - 'description' => __( 'Display your active listings from Zillow.', 're-pro' ), |
|
32 | + 'description' => __('Display your active listings from Zillow.', 're-pro'), |
|
33 | 33 | 'classname' => 're-pro re-pro-widget zillow-widget zillow-widget-my-listings', |
34 | 34 | 'customize_selective_refresh' => true, |
35 | 35 | ) |
@@ -44,21 +44,21 @@ 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 | - $screenname = ! empty( $instance['screenname'] ) ? $instance['screenname'] : ''; |
|
52 | - $zuid = ! empty( $instance['zuid'] ) ? $instance['zuid'] : ''; |
|
53 | - $format = ! empty( $instance['format'] ) ? $instance['format'] : ''; |
|
49 | + $iframe_id = ! empty($args['widget_id']) ? $args['widget_id'] : ''; |
|
50 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
51 | + $screenname = ! empty($instance['screenname']) ? $instance['screenname'] : ''; |
|
52 | + $zuid = ! empty($instance['zuid']) ? $instance['zuid'] : ''; |
|
53 | + $format = ! empty($instance['format']) ? $instance['format'] : ''; |
|
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 | $zillow_widgets = new ZillowWidgets(); |
60 | 60 | |
61 | - return $zillow_widgets->get_listings_widget( $iframe_id, $zuid ); |
|
61 | + return $zillow_widgets->get_listings_widget($iframe_id, $zuid); |
|
62 | 62 | |
63 | 63 | echo $args['after_widget']; |
64 | 64 | } |
@@ -70,10 +70,10 @@ discard block |
||
70 | 70 | * @param mixed $instance Instance. |
71 | 71 | * @return void |
72 | 72 | */ |
73 | - public function form( $instance ) { |
|
73 | + public function form($instance) { |
|
74 | 74 | |
75 | 75 | // Set default values. |
76 | - $instance = wp_parse_args( (array) $instance, array( |
|
76 | + $instance = wp_parse_args((array) $instance, array( |
|
77 | 77 | 'title' => '', |
78 | 78 | 'screenname' => '', |
79 | 79 | 'zuid' => '', |
@@ -81,27 +81,27 @@ discard block |
||
81 | 81 | )); |
82 | 82 | |
83 | 83 | // Retrieve an existing value from the database. |
84 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
85 | - $screenname = ! empty( $instance['screenname'] ) ? $instance['screenname'] : ''; |
|
86 | - $zuid = ! empty( $instance['zuid'] ) ? $instance['zuid'] : ''; |
|
87 | - $format = ! empty( $instance['format'] ) ? $instance['format'] : 'format'; |
|
84 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
85 | + $screenname = ! empty($instance['screenname']) ? $instance['screenname'] : ''; |
|
86 | + $zuid = ! empty($instance['zuid']) ? $instance['zuid'] : ''; |
|
87 | + $format = ! empty($instance['format']) ? $instance['format'] : 'format'; |
|
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 | // Zillow Screenname. |
96 | 96 | echo '<p>'; |
97 | - echo ' <label for="' . $this->get_field_id( 'screenname' ) . '" class="title-label">' . __( 'Zillow Screenname:', 're-pro' ) . '</label>'; |
|
98 | - echo ' <input id="' . $this->get_field_id( 'screenname' ) . '" name="' . $this->get_field_name( 'screenname' ) . '" value="' . $screenname . '" class="widefat">'; |
|
97 | + echo ' <label for="' . $this->get_field_id('screenname') . '" class="title-label">' . __('Zillow Screenname:', 're-pro') . '</label>'; |
|
98 | + echo ' <input id="' . $this->get_field_id('screenname') . '" name="' . $this->get_field_name('screenname') . '" value="' . $screenname . '" class="widefat">'; |
|
99 | 99 | echo '</p>'; |
100 | 100 | |
101 | 101 | // Zillow User ID. |
102 | 102 | echo '<p>'; |
103 | - echo ' <label for="' . $this->get_field_id( 'zuid' ) . '" class="title-label">' . __( 'Zillow User ID:', 're-pro' ) . '</label>'; |
|
104 | - echo ' <input id="' . $this->get_field_id( 'zuid' ) . '" name="' . $this->get_field_name( 'zuid' ) . '" value="' . $zuid . '" class="widefat">'; |
|
103 | + echo ' <label for="' . $this->get_field_id('zuid') . '" class="title-label">' . __('Zillow User ID:', 're-pro') . '</label>'; |
|
104 | + echo ' <input id="' . $this->get_field_id('zuid') . '" name="' . $this->get_field_name('zuid') . '" value="' . $zuid . '" class="widefat">'; |
|
105 | 105 | echo '</p>'; |
106 | 106 | |
107 | 107 | } |
@@ -114,15 +114,15 @@ discard block |
||
114 | 114 | * @param mixed $old_instance Old Instance. |
115 | 115 | * @return $instance |
116 | 116 | */ |
117 | - public function update( $new_instance, $old_instance ) { |
|
117 | + public function update($new_instance, $old_instance) { |
|
118 | 118 | |
119 | 119 | $instance = $old_instance; |
120 | 120 | |
121 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
122 | - $instance['screenname'] = ! empty( $new_instance['screenname'] ) ? strip_tags( $new_instance['screenname'] ) : ''; |
|
123 | - $instance['zuid'] = ! empty( $new_instance['zuid'] ) ? strip_tags( $new_instance['zuid'] ) : ''; |
|
124 | - $instance['format'] = ! empty( $new_instance['format'] ) ? strip_tags( $new_instance['format'] ) : ''; |
|
125 | - $instance['zmod'] = ! empty( $new_instance['zmod'] ) ? strip_tags( $new_instance['zmod'] ) : ''; |
|
121 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
122 | + $instance['screenname'] = ! empty($new_instance['screenname']) ? strip_tags($new_instance['screenname']) : ''; |
|
123 | + $instance['zuid'] = ! empty($new_instance['zuid']) ? strip_tags($new_instance['zuid']) : ''; |
|
124 | + $instance['format'] = ! empty($new_instance['format']) ? strip_tags($new_instance['format']) : ''; |
|
125 | + $instance['zmod'] = ! empty($new_instance['zmod']) ? strip_tags($new_instance['zmod']) : ''; |
|
126 | 126 | |
127 | 127 | return $instance; |
128 | 128 | } |
@@ -106,60 +106,60 @@ |
||
106 | 106 | echo '<p>'; |
107 | 107 | echo ' <label for="' . $this->get_field_id( 'region' ) . '" class="title-label">' . __( 'Region:', 're-pro' ) . '</label>'; |
108 | 108 | echo '<select id="' . $this->get_field_id( 'region' ) . '" name="' . $this->get_field_name( 'region' ) . '" class="widefat">'; |
109 | - echo '<option value="102001"'. selected( $region, 102001 ) .'>'. __( 'United States', 're-pro' ) .'</option>'; |
|
110 | - echo '<option value="3"'. selected( $region, 3 ) .'>Alaska</option>'; |
|
111 | - echo '<option value="4"'. selected( $region, 4 ) .'>Alabama</option>'; |
|
112 | - echo '<option value="6"'. selected( $region, 6 ) .'>Arkansas</option>'; |
|
113 | - echo '<option value="8"'. selected( $region, 8 ) .'>Arizona</option>'; |
|
114 | - echo '<option value="9"'. selected( $region, 9 ) .'>California</option>'; |
|
115 | - echo '<option value="10"'. selected( $region, 10 ) .'>Colorado</option>'; |
|
116 | - echo '<option value="11"'. selected( $region, 11 ) .'>Connecticut</option>'; |
|
117 | - echo '<option value="13"'. selected( $region, 13 ) .'>Delaware</option>'; |
|
118 | - echo '<option value="14"'. selected( $region, 14 ) .'>Florida</option>'; |
|
119 | - echo '<option value="16"'. selected( $region, 16 ) .'>Georgia</option>'; |
|
120 | - echo '<option value="18"'. selected( $region, 18 ) .'>Hawaii</option>'; |
|
121 | - echo '<option value="19"'. selected( $region, 19 ) .'>Iowa</option>'; |
|
122 | - echo '<option value="20"'. selected( $region, 20 ) .'>Idaho</option>'; |
|
123 | - echo '<option value="21"'. selected( $region, 21 ) .'>Illinois</option>'; |
|
124 | - echo '<option value="22"'. selected( $region, 22 ) .'>Indiana</option>'; |
|
125 | - echo '<option value="23"'. selected( $region, 23 ) .'>Kansas</option>'; |
|
126 | - echo '<option value="24"'. selected( $region, 24 ) .'>Kentucky</option>'; |
|
127 | - echo '<option value="25"'. selected( $region, 25 ) .'>Louisiana</option>'; |
|
128 | - echo '<option value="26"'. selected( $region, 26 ) .'>Massachusetts</option>'; |
|
129 | - echo '<option value="27"'. selected( $region, 27 ) .'>Maryland</option>'; |
|
130 | - echo '<option value="28"'. selected( $region, 28 ) .'>Maine</option>'; |
|
131 | - echo '<option value="30"'. selected( $region, 30 ) .'>Michigan</option>'; |
|
132 | - echo '<option value="31"'. selected( $region, 31 ) .'>Minnesota</option>'; |
|
133 | - echo '<option value="32"'. selected( $region, 32 ) .'>Missouri</option>'; |
|
134 | - echo '<option value="34"'. selected( $region, 34 ) .'>Mississippi</option>'; |
|
135 | - echo '<option value="35"'. selected( $region, 35 ) .'>Montana</option>'; |
|
136 | - echo '<option value="36"'. selected( $region, 36 ) .'>North Carolina</option>'; |
|
137 | - echo '<option value="37"'. selected( $region, 37 ) .'>North Dakota</option>'; |
|
138 | - echo '<option value="38"'. selected( $region, 38 ) .'>Nebraska</option>'; |
|
139 | - echo '<option value="39"'. selected( $region, 39 ) .'>New Hampshire</option>'; |
|
140 | - echo '<option value="40"'. selected( $region, 40 ) .'>New Jersey</option>'; |
|
141 | - echo '<option value="41"'. selected( $region, 41 ) .'>New Mexico</option>'; |
|
142 | - echo '<option value="42"'. selected( $region, 42 ) .'>Nevada</option>'; |
|
143 | - echo '<option value="43"'. selected( $region, 43 ) .'>New York</option>'; |
|
144 | - echo '<option value="44"'. selected( $region, 44 ) .'>Ohio</option>'; |
|
145 | - echo '<option value="45"'. selected( $region, 45 ) .'>Oklahoma</option>'; |
|
146 | - echo '<option value="46"'. selected( $region, 46 ) .'>Oregon</option>'; |
|
147 | - echo '<option value="47"'. selected( $region, 47 ) .'>Pennsylvania</option>'; |
|
148 | - echo '<option value="48"'. selected( $region, 48 ) .'>Puerto Rico</option>'; |
|
149 | - echo '<option value="50"'. selected( $region, 50 ) .'>Rhode Island</option>'; |
|
150 | - echo '<option value="51"'. selected( $region, 51 ) .'>South Carolina</option>'; |
|
151 | - echo '<option value="52"'. selected( $region, 52 ) .'>South Dakota</option>'; |
|
152 | - echo '<option value="53"'. selected( $region, 53 ) .'>Tennessee</option>'; |
|
153 | - echo '<option value="54"'. selected( $region, 54 ) .'>Texas</option>'; |
|
154 | - echo '<option value="55"'. selected( $region, 55 ) .'>Utah</option>'; |
|
155 | - echo '<option value="56"'. selected( $region, 56 ) .'>Virginia</option>'; |
|
156 | - echo '<option value="57"'. selected( $region, 57 ) .'>Virgin Islands</option>'; |
|
157 | - echo '<option value="58"'. selected( $region, 58 ) .'>Vermont</option>'; |
|
158 | - echo '<option value="59"'. selected( $region, 59 ) .'>Washington</option>'; |
|
159 | - echo '<option value="12"'. selected( $region, 12 ) .'>Washington, DC</option>'; |
|
160 | - echo '<option value="60"'. selected( $region, 60 ) .'>Wisconsin</option>'; |
|
161 | - echo '<option value="61"'. selected( $region, 61 ) .'>West Virginia</option>'; |
|
162 | - echo '<option value="62"'. selected( $region, 62 ) .'>Wyoming</option>'; |
|
109 | + echo '<option value="102001"'. selected( $region, 102001 ) .'>'. __( 'United States', 're-pro' ) .'</option>'; |
|
110 | + echo '<option value="3"'. selected( $region, 3 ) .'>Alaska</option>'; |
|
111 | + echo '<option value="4"'. selected( $region, 4 ) .'>Alabama</option>'; |
|
112 | + echo '<option value="6"'. selected( $region, 6 ) .'>Arkansas</option>'; |
|
113 | + echo '<option value="8"'. selected( $region, 8 ) .'>Arizona</option>'; |
|
114 | + echo '<option value="9"'. selected( $region, 9 ) .'>California</option>'; |
|
115 | + echo '<option value="10"'. selected( $region, 10 ) .'>Colorado</option>'; |
|
116 | + echo '<option value="11"'. selected( $region, 11 ) .'>Connecticut</option>'; |
|
117 | + echo '<option value="13"'. selected( $region, 13 ) .'>Delaware</option>'; |
|
118 | + echo '<option value="14"'. selected( $region, 14 ) .'>Florida</option>'; |
|
119 | + echo '<option value="16"'. selected( $region, 16 ) .'>Georgia</option>'; |
|
120 | + echo '<option value="18"'. selected( $region, 18 ) .'>Hawaii</option>'; |
|
121 | + echo '<option value="19"'. selected( $region, 19 ) .'>Iowa</option>'; |
|
122 | + echo '<option value="20"'. selected( $region, 20 ) .'>Idaho</option>'; |
|
123 | + echo '<option value="21"'. selected( $region, 21 ) .'>Illinois</option>'; |
|
124 | + echo '<option value="22"'. selected( $region, 22 ) .'>Indiana</option>'; |
|
125 | + echo '<option value="23"'. selected( $region, 23 ) .'>Kansas</option>'; |
|
126 | + echo '<option value="24"'. selected( $region, 24 ) .'>Kentucky</option>'; |
|
127 | + echo '<option value="25"'. selected( $region, 25 ) .'>Louisiana</option>'; |
|
128 | + echo '<option value="26"'. selected( $region, 26 ) .'>Massachusetts</option>'; |
|
129 | + echo '<option value="27"'. selected( $region, 27 ) .'>Maryland</option>'; |
|
130 | + echo '<option value="28"'. selected( $region, 28 ) .'>Maine</option>'; |
|
131 | + echo '<option value="30"'. selected( $region, 30 ) .'>Michigan</option>'; |
|
132 | + echo '<option value="31"'. selected( $region, 31 ) .'>Minnesota</option>'; |
|
133 | + echo '<option value="32"'. selected( $region, 32 ) .'>Missouri</option>'; |
|
134 | + echo '<option value="34"'. selected( $region, 34 ) .'>Mississippi</option>'; |
|
135 | + echo '<option value="35"'. selected( $region, 35 ) .'>Montana</option>'; |
|
136 | + echo '<option value="36"'. selected( $region, 36 ) .'>North Carolina</option>'; |
|
137 | + echo '<option value="37"'. selected( $region, 37 ) .'>North Dakota</option>'; |
|
138 | + echo '<option value="38"'. selected( $region, 38 ) .'>Nebraska</option>'; |
|
139 | + echo '<option value="39"'. selected( $region, 39 ) .'>New Hampshire</option>'; |
|
140 | + echo '<option value="40"'. selected( $region, 40 ) .'>New Jersey</option>'; |
|
141 | + echo '<option value="41"'. selected( $region, 41 ) .'>New Mexico</option>'; |
|
142 | + echo '<option value="42"'. selected( $region, 42 ) .'>Nevada</option>'; |
|
143 | + echo '<option value="43"'. selected( $region, 43 ) .'>New York</option>'; |
|
144 | + echo '<option value="44"'. selected( $region, 44 ) .'>Ohio</option>'; |
|
145 | + echo '<option value="45"'. selected( $region, 45 ) .'>Oklahoma</option>'; |
|
146 | + echo '<option value="46"'. selected( $region, 46 ) .'>Oregon</option>'; |
|
147 | + echo '<option value="47"'. selected( $region, 47 ) .'>Pennsylvania</option>'; |
|
148 | + echo '<option value="48"'. selected( $region, 48 ) .'>Puerto Rico</option>'; |
|
149 | + echo '<option value="50"'. selected( $region, 50 ) .'>Rhode Island</option>'; |
|
150 | + echo '<option value="51"'. selected( $region, 51 ) .'>South Carolina</option>'; |
|
151 | + echo '<option value="52"'. selected( $region, 52 ) .'>South Dakota</option>'; |
|
152 | + echo '<option value="53"'. selected( $region, 53 ) .'>Tennessee</option>'; |
|
153 | + echo '<option value="54"'. selected( $region, 54 ) .'>Texas</option>'; |
|
154 | + echo '<option value="55"'. selected( $region, 55 ) .'>Utah</option>'; |
|
155 | + echo '<option value="56"'. selected( $region, 56 ) .'>Virginia</option>'; |
|
156 | + echo '<option value="57"'. selected( $region, 57 ) .'>Virgin Islands</option>'; |
|
157 | + echo '<option value="58"'. selected( $region, 58 ) .'>Vermont</option>'; |
|
158 | + echo '<option value="59"'. selected( $region, 59 ) .'>Washington</option>'; |
|
159 | + echo '<option value="12"'. selected( $region, 12 ) .'>Washington, DC</option>'; |
|
160 | + echo '<option value="60"'. selected( $region, 60 ) .'>Wisconsin</option>'; |
|
161 | + echo '<option value="61"'. selected( $region, 61 ) .'>West Virginia</option>'; |
|
162 | + echo '<option value="62"'. selected( $region, 62 ) .'>Wyoming</option>'; |
|
163 | 163 | echo '</select>'; |
164 | 164 | echo '</p>'; |
165 | 165 |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /* Exit if accessed directly. */ |
4 | -if ( ! defined( 'ABSPATH' ) ) { exit; } |
|
4 | +if ( ! defined('ABSPATH')) { exit; } |
|
5 | 5 | |
6 | 6 | /** |
7 | 7 | * Zillow Mortgage Rate Widget (https://www.zillow.com/webtools/widgets/MortgageRateWidget.htm) |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | |
28 | 28 | parent::__construct( |
29 | 29 | 'zillow_mortgage_rate_widget', |
30 | - __( 'Zillow Mortgage Rate Table', 're-pro' ), |
|
30 | + __('Zillow Mortgage Rate Table', 're-pro'), |
|
31 | 31 | array( |
32 | - 'description' => __( 'Display a Mortgage Rate Table from Zillow.', 're-pro' ), |
|
32 | + 'description' => __('Display a Mortgage Rate Table from Zillow.', 're-pro'), |
|
33 | 33 | 'classname' => 're-pro re-pro-widget zillow-widget zillow-widget-mortgage-rate-table', |
34 | 34 | 'customize_selective_refresh' => true, |
35 | 35 | ) |
@@ -44,23 +44,23 @@ 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 | - $screenname = ! empty( $instance['screenname'] ) ? $instance['screenname'] : ''; |
|
52 | - $region = ! empty( $instance['region'] ) ? $instance['region'] : ''; |
|
53 | - $textcolor = ! empty( $instance['textcolor'] ) ? $instance['textcolor'] : ''; |
|
49 | + $iframe_id = ! empty($args['widget_id']) ? $args['widget_id'] : ''; |
|
50 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
51 | + $screenname = ! empty($instance['screenname']) ? $instance['screenname'] : ''; |
|
52 | + $region = ! empty($instance['region']) ? $instance['region'] : ''; |
|
53 | + $textcolor = ! empty($instance['textcolor']) ? $instance['textcolor'] : ''; |
|
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 | |
61 | 61 | $zillow_widgets = new ZillowWidgets(); |
62 | 62 | |
63 | - return $zillow_widgets->get_mortgage_rate_table_widget( $iframe_id, $textcolor, $screenname, $region ); |
|
63 | + return $zillow_widgets->get_mortgage_rate_table_widget($iframe_id, $textcolor, $screenname, $region); |
|
64 | 64 | |
65 | 65 | echo $args['after_widget']; |
66 | 66 | } |
@@ -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 | 'screenname' => '', |
81 | 81 | 'region' => '', |
@@ -84,89 +84,89 @@ discard block |
||
84 | 84 | )); |
85 | 85 | |
86 | 86 | // Retrieve an existing value from the database. |
87 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
88 | - $screenname = ! empty( $instance['screenname'] ) ? $instance['screenname'] : ''; |
|
89 | - $textcolor = ! empty( $instance['textcolor'] ) ? $instance['textcolor'] : ''; |
|
90 | - $region = ! empty( $instance['region'] ) ? $instance['region'] : ''; |
|
91 | - $zuid = ! empty( $instance['zuid'] ) ? $instance['zuid'] : ''; |
|
87 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
88 | + $screenname = ! empty($instance['screenname']) ? $instance['screenname'] : ''; |
|
89 | + $textcolor = ! empty($instance['textcolor']) ? $instance['textcolor'] : ''; |
|
90 | + $region = ! empty($instance['region']) ? $instance['region'] : ''; |
|
91 | + $zuid = ! empty($instance['zuid']) ? $instance['zuid'] : ''; |
|
92 | 92 | |
93 | 93 | // Title. |
94 | 94 | echo '<p>'; |
95 | - echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>'; |
|
96 | - echo ' <input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title . '" class="widefat">'; |
|
95 | + echo ' <label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>'; |
|
96 | + echo ' <input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">'; |
|
97 | 97 | echo '</p>'; |
98 | 98 | |
99 | 99 | // Zillow Screenname. |
100 | 100 | echo '<p>'; |
101 | - echo ' <label for="' . $this->get_field_id( 'screenname' ) . '" class="title-label">' . __( 'Zillow Screenname:', 're-pro' ) . '</label>'; |
|
102 | - echo ' <input id="' . $this->get_field_id( 'screenname' ) . '" name="' . $this->get_field_name( 'screenname' ) . '" value="' . $screenname . '" class="widefat">'; |
|
101 | + echo ' <label for="' . $this->get_field_id('screenname') . '" class="title-label">' . __('Zillow Screenname:', 're-pro') . '</label>'; |
|
102 | + echo ' <input id="' . $this->get_field_id('screenname') . '" name="' . $this->get_field_name('screenname') . '" value="' . $screenname . '" class="widefat">'; |
|
103 | 103 | echo '</p>'; |
104 | 104 | |
105 | 105 | // Select a State. |
106 | 106 | echo '<p>'; |
107 | - echo ' <label for="' . $this->get_field_id( 'region' ) . '" class="title-label">' . __( 'Region:', 're-pro' ) . '</label>'; |
|
108 | - echo '<select id="' . $this->get_field_id( 'region' ) . '" name="' . $this->get_field_name( 'region' ) . '" class="widefat">'; |
|
109 | - echo '<option value="102001"'. selected( $region, 102001 ) .'>'. __( 'United States', 're-pro' ) .'</option>'; |
|
110 | - echo '<option value="3"'. selected( $region, 3 ) .'>Alaska</option>'; |
|
111 | - echo '<option value="4"'. selected( $region, 4 ) .'>Alabama</option>'; |
|
112 | - echo '<option value="6"'. selected( $region, 6 ) .'>Arkansas</option>'; |
|
113 | - echo '<option value="8"'. selected( $region, 8 ) .'>Arizona</option>'; |
|
114 | - echo '<option value="9"'. selected( $region, 9 ) .'>California</option>'; |
|
115 | - echo '<option value="10"'. selected( $region, 10 ) .'>Colorado</option>'; |
|
116 | - echo '<option value="11"'. selected( $region, 11 ) .'>Connecticut</option>'; |
|
117 | - echo '<option value="13"'. selected( $region, 13 ) .'>Delaware</option>'; |
|
118 | - echo '<option value="14"'. selected( $region, 14 ) .'>Florida</option>'; |
|
119 | - echo '<option value="16"'. selected( $region, 16 ) .'>Georgia</option>'; |
|
120 | - echo '<option value="18"'. selected( $region, 18 ) .'>Hawaii</option>'; |
|
121 | - echo '<option value="19"'. selected( $region, 19 ) .'>Iowa</option>'; |
|
122 | - echo '<option value="20"'. selected( $region, 20 ) .'>Idaho</option>'; |
|
123 | - echo '<option value="21"'. selected( $region, 21 ) .'>Illinois</option>'; |
|
124 | - echo '<option value="22"'. selected( $region, 22 ) .'>Indiana</option>'; |
|
125 | - echo '<option value="23"'. selected( $region, 23 ) .'>Kansas</option>'; |
|
126 | - echo '<option value="24"'. selected( $region, 24 ) .'>Kentucky</option>'; |
|
127 | - echo '<option value="25"'. selected( $region, 25 ) .'>Louisiana</option>'; |
|
128 | - echo '<option value="26"'. selected( $region, 26 ) .'>Massachusetts</option>'; |
|
129 | - echo '<option value="27"'. selected( $region, 27 ) .'>Maryland</option>'; |
|
130 | - echo '<option value="28"'. selected( $region, 28 ) .'>Maine</option>'; |
|
131 | - echo '<option value="30"'. selected( $region, 30 ) .'>Michigan</option>'; |
|
132 | - echo '<option value="31"'. selected( $region, 31 ) .'>Minnesota</option>'; |
|
133 | - echo '<option value="32"'. selected( $region, 32 ) .'>Missouri</option>'; |
|
134 | - echo '<option value="34"'. selected( $region, 34 ) .'>Mississippi</option>'; |
|
135 | - echo '<option value="35"'. selected( $region, 35 ) .'>Montana</option>'; |
|
136 | - echo '<option value="36"'. selected( $region, 36 ) .'>North Carolina</option>'; |
|
137 | - echo '<option value="37"'. selected( $region, 37 ) .'>North Dakota</option>'; |
|
138 | - echo '<option value="38"'. selected( $region, 38 ) .'>Nebraska</option>'; |
|
139 | - echo '<option value="39"'. selected( $region, 39 ) .'>New Hampshire</option>'; |
|
140 | - echo '<option value="40"'. selected( $region, 40 ) .'>New Jersey</option>'; |
|
141 | - echo '<option value="41"'. selected( $region, 41 ) .'>New Mexico</option>'; |
|
142 | - echo '<option value="42"'. selected( $region, 42 ) .'>Nevada</option>'; |
|
143 | - echo '<option value="43"'. selected( $region, 43 ) .'>New York</option>'; |
|
144 | - echo '<option value="44"'. selected( $region, 44 ) .'>Ohio</option>'; |
|
145 | - echo '<option value="45"'. selected( $region, 45 ) .'>Oklahoma</option>'; |
|
146 | - echo '<option value="46"'. selected( $region, 46 ) .'>Oregon</option>'; |
|
147 | - echo '<option value="47"'. selected( $region, 47 ) .'>Pennsylvania</option>'; |
|
148 | - echo '<option value="48"'. selected( $region, 48 ) .'>Puerto Rico</option>'; |
|
149 | - echo '<option value="50"'. selected( $region, 50 ) .'>Rhode Island</option>'; |
|
150 | - echo '<option value="51"'. selected( $region, 51 ) .'>South Carolina</option>'; |
|
151 | - echo '<option value="52"'. selected( $region, 52 ) .'>South Dakota</option>'; |
|
152 | - echo '<option value="53"'. selected( $region, 53 ) .'>Tennessee</option>'; |
|
153 | - echo '<option value="54"'. selected( $region, 54 ) .'>Texas</option>'; |
|
154 | - echo '<option value="55"'. selected( $region, 55 ) .'>Utah</option>'; |
|
155 | - echo '<option value="56"'. selected( $region, 56 ) .'>Virginia</option>'; |
|
156 | - echo '<option value="57"'. selected( $region, 57 ) .'>Virgin Islands</option>'; |
|
157 | - echo '<option value="58"'. selected( $region, 58 ) .'>Vermont</option>'; |
|
158 | - echo '<option value="59"'. selected( $region, 59 ) .'>Washington</option>'; |
|
159 | - echo '<option value="12"'. selected( $region, 12 ) .'>Washington, DC</option>'; |
|
160 | - echo '<option value="60"'. selected( $region, 60 ) .'>Wisconsin</option>'; |
|
161 | - echo '<option value="61"'. selected( $region, 61 ) .'>West Virginia</option>'; |
|
162 | - echo '<option value="62"'. selected( $region, 62 ) .'>Wyoming</option>'; |
|
107 | + echo ' <label for="' . $this->get_field_id('region') . '" class="title-label">' . __('Region:', 're-pro') . '</label>'; |
|
108 | + echo '<select id="' . $this->get_field_id('region') . '" name="' . $this->get_field_name('region') . '" class="widefat">'; |
|
109 | + echo '<option value="102001"' . selected($region, 102001) . '>' . __('United States', 're-pro') . '</option>'; |
|
110 | + echo '<option value="3"' . selected($region, 3) . '>Alaska</option>'; |
|
111 | + echo '<option value="4"' . selected($region, 4) . '>Alabama</option>'; |
|
112 | + echo '<option value="6"' . selected($region, 6) . '>Arkansas</option>'; |
|
113 | + echo '<option value="8"' . selected($region, 8) . '>Arizona</option>'; |
|
114 | + echo '<option value="9"' . selected($region, 9) . '>California</option>'; |
|
115 | + echo '<option value="10"' . selected($region, 10) . '>Colorado</option>'; |
|
116 | + echo '<option value="11"' . selected($region, 11) . '>Connecticut</option>'; |
|
117 | + echo '<option value="13"' . selected($region, 13) . '>Delaware</option>'; |
|
118 | + echo '<option value="14"' . selected($region, 14) . '>Florida</option>'; |
|
119 | + echo '<option value="16"' . selected($region, 16) . '>Georgia</option>'; |
|
120 | + echo '<option value="18"' . selected($region, 18) . '>Hawaii</option>'; |
|
121 | + echo '<option value="19"' . selected($region, 19) . '>Iowa</option>'; |
|
122 | + echo '<option value="20"' . selected($region, 20) . '>Idaho</option>'; |
|
123 | + echo '<option value="21"' . selected($region, 21) . '>Illinois</option>'; |
|
124 | + echo '<option value="22"' . selected($region, 22) . '>Indiana</option>'; |
|
125 | + echo '<option value="23"' . selected($region, 23) . '>Kansas</option>'; |
|
126 | + echo '<option value="24"' . selected($region, 24) . '>Kentucky</option>'; |
|
127 | + echo '<option value="25"' . selected($region, 25) . '>Louisiana</option>'; |
|
128 | + echo '<option value="26"' . selected($region, 26) . '>Massachusetts</option>'; |
|
129 | + echo '<option value="27"' . selected($region, 27) . '>Maryland</option>'; |
|
130 | + echo '<option value="28"' . selected($region, 28) . '>Maine</option>'; |
|
131 | + echo '<option value="30"' . selected($region, 30) . '>Michigan</option>'; |
|
132 | + echo '<option value="31"' . selected($region, 31) . '>Minnesota</option>'; |
|
133 | + echo '<option value="32"' . selected($region, 32) . '>Missouri</option>'; |
|
134 | + echo '<option value="34"' . selected($region, 34) . '>Mississippi</option>'; |
|
135 | + echo '<option value="35"' . selected($region, 35) . '>Montana</option>'; |
|
136 | + echo '<option value="36"' . selected($region, 36) . '>North Carolina</option>'; |
|
137 | + echo '<option value="37"' . selected($region, 37) . '>North Dakota</option>'; |
|
138 | + echo '<option value="38"' . selected($region, 38) . '>Nebraska</option>'; |
|
139 | + echo '<option value="39"' . selected($region, 39) . '>New Hampshire</option>'; |
|
140 | + echo '<option value="40"' . selected($region, 40) . '>New Jersey</option>'; |
|
141 | + echo '<option value="41"' . selected($region, 41) . '>New Mexico</option>'; |
|
142 | + echo '<option value="42"' . selected($region, 42) . '>Nevada</option>'; |
|
143 | + echo '<option value="43"' . selected($region, 43) . '>New York</option>'; |
|
144 | + echo '<option value="44"' . selected($region, 44) . '>Ohio</option>'; |
|
145 | + echo '<option value="45"' . selected($region, 45) . '>Oklahoma</option>'; |
|
146 | + echo '<option value="46"' . selected($region, 46) . '>Oregon</option>'; |
|
147 | + echo '<option value="47"' . selected($region, 47) . '>Pennsylvania</option>'; |
|
148 | + echo '<option value="48"' . selected($region, 48) . '>Puerto Rico</option>'; |
|
149 | + echo '<option value="50"' . selected($region, 50) . '>Rhode Island</option>'; |
|
150 | + echo '<option value="51"' . selected($region, 51) . '>South Carolina</option>'; |
|
151 | + echo '<option value="52"' . selected($region, 52) . '>South Dakota</option>'; |
|
152 | + echo '<option value="53"' . selected($region, 53) . '>Tennessee</option>'; |
|
153 | + echo '<option value="54"' . selected($region, 54) . '>Texas</option>'; |
|
154 | + echo '<option value="55"' . selected($region, 55) . '>Utah</option>'; |
|
155 | + echo '<option value="56"' . selected($region, 56) . '>Virginia</option>'; |
|
156 | + echo '<option value="57"' . selected($region, 57) . '>Virgin Islands</option>'; |
|
157 | + echo '<option value="58"' . selected($region, 58) . '>Vermont</option>'; |
|
158 | + echo '<option value="59"' . selected($region, 59) . '>Washington</option>'; |
|
159 | + echo '<option value="12"' . selected($region, 12) . '>Washington, DC</option>'; |
|
160 | + echo '<option value="60"' . selected($region, 60) . '>Wisconsin</option>'; |
|
161 | + echo '<option value="61"' . selected($region, 61) . '>West Virginia</option>'; |
|
162 | + echo '<option value="62"' . selected($region, 62) . '>Wyoming</option>'; |
|
163 | 163 | echo '</select>'; |
164 | 164 | echo '</p>'; |
165 | 165 | |
166 | 166 | // Text Color |
167 | 167 | echo '<p>'; |
168 | - echo ' <label for="' . $this->get_field_id( 'textcolor' ) . '" class="title-label">' . __( 'Text Color:', 're-pro' ) . '</label>'; |
|
169 | - echo ' <input id="' . $this->get_field_id( 'textcolor' ) . '" name="' . $this->get_field_name( 'textcolor' ) . '" value="' . $textcolor . '" class="widefat">'; |
|
168 | + echo ' <label for="' . $this->get_field_id('textcolor') . '" class="title-label">' . __('Text Color:', 're-pro') . '</label>'; |
|
169 | + echo ' <input id="' . $this->get_field_id('textcolor') . '" name="' . $this->get_field_name('textcolor') . '" value="' . $textcolor . '" class="widefat">'; |
|
170 | 170 | echo '</p>'; |
171 | 171 | |
172 | 172 | } |
@@ -179,14 +179,14 @@ discard block |
||
179 | 179 | * @param mixed $old_instance Old Instance. |
180 | 180 | * @return $instance |
181 | 181 | */ |
182 | - public function update( $new_instance, $old_instance ) { |
|
182 | + public function update($new_instance, $old_instance) { |
|
183 | 183 | |
184 | 184 | $instance = $old_instance; |
185 | 185 | |
186 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
187 | - $instance['screenname'] = ! empty( $new_instance['screenname'] ) ? strip_tags( $new_instance['screenname'] ) : ''; |
|
188 | - $instance['region'] = ! empty( $new_instance['region'] ) ? strip_tags( $new_instance['region'] ) : ''; |
|
189 | - $instance['textcolor'] = ! empty( $new_instance['textcolor'] ) ? strip_tags( $new_instance['textcolor'] ) : ''; |
|
186 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
187 | + $instance['screenname'] = ! empty($new_instance['screenname']) ? strip_tags($new_instance['screenname']) : ''; |
|
188 | + $instance['region'] = ! empty($new_instance['region']) ? strip_tags($new_instance['region']) : ''; |
|
189 | + $instance['textcolor'] = ! empty($new_instance['textcolor']) ? strip_tags($new_instance['textcolor']) : ''; |
|
190 | 190 | |
191 | 191 | return $instance; |
192 | 192 | } |
@@ -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 Expensive Homes Widget (https://www.zillow.com/webtools/widgets/MostExpensiveHomes.htm) |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | |
28 | 28 | parent::__construct( |
29 | 29 | 'zillow_expensive_homes_widget', |
30 | - __( 'Zillow Most Expensive Homes', 're-pro' ), |
|
30 | + __('Zillow Most Expensive Homes', 're-pro'), |
|
31 | 31 | array( |
32 | - 'description' => __( 'Display the most expensive homes from Zillow.', 're-pro' ), |
|
32 | + 'description' => __('Display the most expensive homes from Zillow.', 're-pro'), |
|
33 | 33 | 'classname' => 're-pro re-pro-widget zillow-widget zillow-widget-expensive-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_expensive_homes_widget( $iframe_id, $location, 'iframe', 'wide' ); |
|
62 | + $zillow_widgets->get_expensive_homes_widget($iframe_id, $location, 'iframe', 'wide'); |
|
63 | 63 | |
64 | 64 | echo $args['after_widget']; |
65 | 65 | } |
@@ -71,10 +71,10 @@ discard block |
||
71 | 71 | * @param mixed $instance Instance. |
72 | 72 | * @return void |
73 | 73 | */ |
74 | - public function form( $instance ) { |
|
74 | + public function form($instance) { |
|
75 | 75 | |
76 | 76 | // Set default values. |
77 | - $instance = wp_parse_args( (array) $instance, array( |
|
77 | + $instance = wp_parse_args((array) $instance, array( |
|
78 | 78 | 'title' => '', |
79 | 79 | 'type' => 'iframe', |
80 | 80 | 'size' => 'wide', |
@@ -82,19 +82,19 @@ discard block |
||
82 | 82 | )); |
83 | 83 | |
84 | 84 | // Retrieve an existing value from the database. |
85 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
86 | - $location = ! empty( $instance['location'] ) ? $instance['location'] : ''; |
|
85 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
86 | + $location = ! empty($instance['location']) ? $instance['location'] : ''; |
|
87 | 87 | |
88 | 88 | // Title. |
89 | 89 | echo '<p>'; |
90 | - echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>'; |
|
91 | - echo ' <input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title . '" class="widefat">'; |
|
90 | + echo ' <label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>'; |
|
91 | + echo ' <input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">'; |
|
92 | 92 | echo '</p>'; |
93 | 93 | |
94 | 94 | // Location. |
95 | 95 | echo '<p>'; |
96 | - echo ' <label for="' . $this->get_field_id( 'location' ) . '" class="title-label">' . __( 'Location:', 're-pro' ) . '</label>'; |
|
97 | - echo ' <input id="' . $this->get_field_id( 'location' ) . '" placeholder="El Segundo, CA" name="' . $this->get_field_name( 'location' ) . '" value="' . $location . '" class="widefat">'; |
|
96 | + echo ' <label for="' . $this->get_field_id('location') . '" class="title-label">' . __('Location:', 're-pro') . '</label>'; |
|
97 | + echo ' <input id="' . $this->get_field_id('location') . '" placeholder="El Segundo, CA" name="' . $this->get_field_name('location') . '" value="' . $location . '" class="widefat">'; |
|
98 | 98 | echo '</p>'; |
99 | 99 | |
100 | 100 | } |
@@ -107,14 +107,14 @@ discard block |
||
107 | 107 | * @param mixed $old_instance Old Instance. |
108 | 108 | * @return $instance |
109 | 109 | */ |
110 | - public function update( $new_instance, $old_instance ) { |
|
110 | + public function update($new_instance, $old_instance) { |
|
111 | 111 | |
112 | 112 | $instance = $old_instance; |
113 | 113 | |
114 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
115 | - $instance['type'] = ! empty( $new_instance['type'] ) ? strip_tags( $new_instance['type'] ) : ''; |
|
116 | - $instance['size'] = ! empty( $new_instance['size'] ) ? strip_tags( $new_instance['size'] ) : ''; |
|
117 | - $instance['location'] = ! empty( $new_instance['location'] ) ? strip_tags( $new_instance['location'] ) : ''; |
|
114 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
115 | + $instance['type'] = ! empty($new_instance['type']) ? strip_tags($new_instance['type']) : ''; |
|
116 | + $instance['size'] = ! empty($new_instance['size']) ? strip_tags($new_instance['size']) : ''; |
|
117 | + $instance['location'] = ! empty($new_instance['location']) ? strip_tags($new_instance['location']) : ''; |
|
118 | 118 | |
119 | 119 | return $instance; |
120 | 120 | } |
@@ -128,6 +128,6 @@ discard block |
||
128 | 128 | */ |
129 | 129 | function repro_zillow_expensive_homes_widget() { |
130 | 130 | |
131 | - register_widget( 'ZillowExpensiveHomesWidget' ); |
|
131 | + register_widget('ZillowExpensiveHomesWidget'); |
|
132 | 132 | } |
133 | -add_action( 'widgets_init', 'repro_zillow_expensive_homes_widget' ); |
|
133 | +add_action('widgets_init', 'repro_zillow_expensive_homes_widget'); |
@@ -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 Review Widget (https://www.zillow.com/webtools/widgets/review-widget/) |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | |
28 | 28 | parent::__construct( |
29 | 29 | 'zillow_review_widget', |
30 | - __( 'Zillow Reviews', 're-pro' ), |
|
30 | + __('Zillow Reviews', 're-pro'), |
|
31 | 31 | array( |
32 | - 'description' => __( 'Display a ratings link to your Zillow Reviews.', 're-pro' ), |
|
32 | + 'description' => __('Display a ratings link to your Zillow Reviews.', 're-pro'), |
|
33 | 33 | 'classname' => 're-pro re-pro-widget zillow-widget zillow-widget-reviews', |
34 | 34 | 'customize_selective_refresh' => true, |
35 | 35 | ) |
@@ -44,24 +44,24 @@ discard block |
||
44 | 44 | * @param mixed $instance Instance. |
45 | 45 | * @return void |
46 | 46 | */ |
47 | - public function widget( $args, $instance ) { |
|
47 | + public function widget($args, $instance) { |
|
48 | 48 | |
49 | - $iframe_id = ! empty( $args['widget_id'] ) ? $args['widget_id'] : ''; |
|
50 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
51 | - $screenname = ! empty( $instance['screenname'] ) ? $instance['screenname'] : ''; |
|
52 | - $zuid = ! empty( $instance['zuid'] ) ? $instance['zuid'] : ''; |
|
53 | - $size = ! empty( $instance['size'] ) ? $instance['size'] : 'wide'; |
|
54 | - $zmod = ! empty( $instance['zmod'] ) ? $instance['zmod'] : 'true'; |
|
55 | - $height = ! empty( $instance['height'] ) ? $instance['height'] : ''; |
|
56 | - $width = ! empty( $instance['width'] ) ? $instance['width'] : ''; |
|
49 | + $iframe_id = ! empty($args['widget_id']) ? $args['widget_id'] : ''; |
|
50 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
51 | + $screenname = ! empty($instance['screenname']) ? $instance['screenname'] : ''; |
|
52 | + $zuid = ! empty($instance['zuid']) ? $instance['zuid'] : ''; |
|
53 | + $size = ! empty($instance['size']) ? $instance['size'] : 'wide'; |
|
54 | + $zmod = ! empty($instance['zmod']) ? $instance['zmod'] : 'true'; |
|
55 | + $height = ! empty($instance['height']) ? $instance['height'] : ''; |
|
56 | + $width = ! empty($instance['width']) ? $instance['width'] : ''; |
|
57 | 57 | |
58 | 58 | echo $args['before_widget']; |
59 | 59 | |
60 | - echo $args['before_title'] . esc_attr( $title ) . $args['after_title']; |
|
60 | + echo $args['before_title'] . esc_attr($title) . $args['after_title']; |
|
61 | 61 | |
62 | 62 | $zillow_widgets = new ZillowWidgets(); |
63 | 63 | |
64 | - $zillow_widgets->get_review_widget( $iframe_id, $zuid, $screenname, $size, $zmod, $width, $height ); |
|
64 | + $zillow_widgets->get_review_widget($iframe_id, $zuid, $screenname, $size, $zmod, $width, $height); |
|
65 | 65 | |
66 | 66 | echo $args['after_widget']; |
67 | 67 | } |
@@ -73,10 +73,10 @@ discard block |
||
73 | 73 | * @param mixed $instance Instance. |
74 | 74 | * @return void |
75 | 75 | */ |
76 | - public function form( $instance ) { |
|
76 | + public function form($instance) { |
|
77 | 77 | |
78 | 78 | // Set default values. |
79 | - $instance = wp_parse_args( (array) $instance, array( |
|
79 | + $instance = wp_parse_args((array) $instance, array( |
|
80 | 80 | 'title' => '', |
81 | 81 | 'screenname' => '', |
82 | 82 | 'zuid' => '', |
@@ -85,42 +85,42 @@ discard block |
||
85 | 85 | )); |
86 | 86 | |
87 | 87 | // Retrieve an existing value from the database. |
88 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
89 | - $screenname = ! empty( $instance['screenname'] ) ? $instance['screenname'] : ''; |
|
90 | - $zuid = ! empty( $instance['zuid'] ) ? $instance['zuid'] : ''; |
|
91 | - $size = ! empty( $instance['size'] ) ? $instance['size'] : ''; |
|
92 | - $zmod = ! empty( $instance['zmod'] ) ? $instance['zmod'] : ''; |
|
93 | - $height = ! empty( $instance['height'] ) ? $instance['height'] : ''; |
|
94 | - $width = ! empty( $instance['width'] ) ? $instance['width'] : ''; |
|
88 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
89 | + $screenname = ! empty($instance['screenname']) ? $instance['screenname'] : ''; |
|
90 | + $zuid = ! empty($instance['zuid']) ? $instance['zuid'] : ''; |
|
91 | + $size = ! empty($instance['size']) ? $instance['size'] : ''; |
|
92 | + $zmod = ! empty($instance['zmod']) ? $instance['zmod'] : ''; |
|
93 | + $height = ! empty($instance['height']) ? $instance['height'] : ''; |
|
94 | + $width = ! empty($instance['width']) ? $instance['width'] : ''; |
|
95 | 95 | |
96 | 96 | // Title. |
97 | 97 | echo '<p>'; |
98 | - echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>'; |
|
99 | - echo ' <input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title . '" class="widefat">'; |
|
98 | + echo ' <label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>'; |
|
99 | + echo ' <input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">'; |
|
100 | 100 | echo '</p>'; |
101 | 101 | |
102 | 102 | // Zillow Screenname. |
103 | 103 | echo '<p>'; |
104 | - echo ' <label for="' . $this->get_field_id( 'screenname' ) . '" class="title-label">' . __( 'Zillow Screenname:', 're-pro' ) . '</label>'; |
|
105 | - echo ' <input id="' . $this->get_field_id( 'screenname' ) . '" name="' . $this->get_field_name( 'screenname' ) . '" value="' . $screenname . '" class="widefat">'; |
|
104 | + echo ' <label for="' . $this->get_field_id('screenname') . '" class="title-label">' . __('Zillow Screenname:', 're-pro') . '</label>'; |
|
105 | + echo ' <input id="' . $this->get_field_id('screenname') . '" name="' . $this->get_field_name('screenname') . '" value="' . $screenname . '" class="widefat">'; |
|
106 | 106 | echo '</p>'; |
107 | 107 | |
108 | 108 | // Zillow User ID. |
109 | 109 | echo '<p>'; |
110 | - echo ' <label for="' . $this->get_field_id( 'zuid' ) . '" class="title-label">' . __( 'Zillow User ID:', 're-pro' ) . '</label>'; |
|
111 | - echo ' <input id="' . $this->get_field_id( 'zuid' ) . '" name="' . $this->get_field_name( 'zuid' ) . '" value="' . $zuid . '" class="widefat">'; |
|
110 | + echo ' <label for="' . $this->get_field_id('zuid') . '" class="title-label">' . __('Zillow User ID:', 're-pro') . '</label>'; |
|
111 | + echo ' <input id="' . $this->get_field_id('zuid') . '" name="' . $this->get_field_name('zuid') . '" value="' . $zuid . '" class="widefat">'; |
|
112 | 112 | echo '</p>'; |
113 | 113 | |
114 | 114 | // Width Option. |
115 | 115 | echo '<p>'; |
116 | - echo ' <label for="' . $this->get_field_id( 'width' ) . '" class="title-label">' . __( 'Width:', 're-pro' ) . '</label>'; |
|
117 | - echo ' <input id="' . $this->get_field_id( 'width' ) . '" name="' . $this->get_field_name( 'width' ) . '" value="' . $width . '" class="widefat">'; |
|
116 | + echo ' <label for="' . $this->get_field_id('width') . '" class="title-label">' . __('Width:', 're-pro') . '</label>'; |
|
117 | + echo ' <input id="' . $this->get_field_id('width') . '" name="' . $this->get_field_name('width') . '" value="' . $width . '" class="widefat">'; |
|
118 | 118 | echo '</p>'; |
119 | 119 | |
120 | 120 | // Height Option |
121 | 121 | echo '<p>'; |
122 | - echo ' <label for="' . $this->get_field_id( 'height' ) . '" class="title-label">' . __( 'Height:', 're-pro' ) . '</label>'; |
|
123 | - echo ' <input id="' . $this->get_field_id( 'height' ) . '" name="' . $this->get_field_name( 'height' ) . '" value="' . $height . '" class="widefat">'; |
|
122 | + echo ' <label for="' . $this->get_field_id('height') . '" class="title-label">' . __('Height:', 're-pro') . '</label>'; |
|
123 | + echo ' <input id="' . $this->get_field_id('height') . '" name="' . $this->get_field_name('height') . '" value="' . $height . '" class="widefat">'; |
|
124 | 124 | echo '</p>'; |
125 | 125 | |
126 | 126 | } |
@@ -133,17 +133,17 @@ discard block |
||
133 | 133 | * @param mixed $old_instance Old Instance. |
134 | 134 | * @return $instance |
135 | 135 | */ |
136 | - public function update( $new_instance, $old_instance ) { |
|
136 | + public function update($new_instance, $old_instance) { |
|
137 | 137 | |
138 | 138 | $instance = $old_instance; |
139 | 139 | |
140 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
141 | - $instance['screenname'] = ! empty( $new_instance['screenname'] ) ? strip_tags( $new_instance['screenname'] ) : ''; |
|
142 | - $instance['zuid'] = ! empty( $new_instance['zuid'] ) ? strip_tags( $new_instance['zuid'] ) : ''; |
|
143 | - $instance['size'] = ! empty( $new_instance['size'] ) ? strip_tags( $new_instance['size'] ) : ''; |
|
144 | - $instance['zmod'] = ! empty( $new_instance['zmod'] ) ? strip_tags( $new_instance['zmod'] ) : ''; |
|
145 | - $instance['height'] = ! empty( $new_instance['height'] ) ? strip_tags( $new_instance['height'] ) : ''; |
|
146 | - $instance['width'] = ! empty( $new_instance['width'] ) ? strip_tags( $new_instance['width'] ) : ''; |
|
140 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
141 | + $instance['screenname'] = ! empty($new_instance['screenname']) ? strip_tags($new_instance['screenname']) : ''; |
|
142 | + $instance['zuid'] = ! empty($new_instance['zuid']) ? strip_tags($new_instance['zuid']) : ''; |
|
143 | + $instance['size'] = ! empty($new_instance['size']) ? strip_tags($new_instance['size']) : ''; |
|
144 | + $instance['zmod'] = ! empty($new_instance['zmod']) ? strip_tags($new_instance['zmod']) : ''; |
|
145 | + $instance['height'] = ! empty($new_instance['height']) ? strip_tags($new_instance['height']) : ''; |
|
146 | + $instance['width'] = ! empty($new_instance['width']) ? strip_tags($new_instance['width']) : ''; |
|
147 | 147 | |
148 | 148 | return $instance; |
149 | 149 | } |
@@ -157,6 +157,6 @@ discard block |
||
157 | 157 | */ |
158 | 158 | function repro_zillow_review_widget() { |
159 | 159 | |
160 | - register_widget( 'ZillowReviewWidget' ); |
|
160 | + register_widget('ZillowReviewWidget'); |
|
161 | 161 | } |
162 | -add_action( 'widgets_init', 'repro_zillow_review_widget' ); |
|
162 | +add_action('widgets_init', 'repro_zillow_review_widget'); |
@@ -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 Contact Widget (https://www.zillow.com/webtools/widgets/contact-form-widget.htm) |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | |
28 | 28 | parent::__construct( |
29 | 29 | 'zillow_contact_widget', |
30 | - __( 'Zillow Contact Form', 're-pro' ), |
|
30 | + __('Zillow Contact Form', 're-pro'), |
|
31 | 31 | array( |
32 | - 'description' => __( 'Display a form to contact you on Zillow.', 're-pro' ), |
|
32 | + 'description' => __('Display a form to contact you on Zillow.', 're-pro'), |
|
33 | 33 | 'classname' => 're-pro re-pro-widget zillow-widget zillow-widget-contact', |
34 | 34 | 'customize_selective_refresh' => true, |
35 | 35 | ) |
@@ -44,21 +44,21 @@ 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 | - $screenname = ! empty( $instance['screenname'] ) ? $instance['screenname'] : ''; |
|
52 | - $email = ! empty( $instance['email'] ) ? $instance['email'] : ''; |
|
53 | - $zuid = ! empty( $instance['zuid'] ) ? $instance['zuid'] : ''; |
|
49 | + $iframe_id = ! empty($args['widget_id']) ? $args['widget_id'] : ''; |
|
50 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
51 | + $screenname = ! empty($instance['screenname']) ? $instance['screenname'] : ''; |
|
52 | + $email = ! empty($instance['email']) ? $instance['email'] : ''; |
|
53 | + $zuid = ! empty($instance['zuid']) ? $instance['zuid'] : ''; |
|
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 | $zillow_widgets = new ZillowWidgets(); |
60 | 60 | |
61 | - return $zillow_widgets->get_contact_widget( $iframe_id, $email ); |
|
61 | + return $zillow_widgets->get_contact_widget($iframe_id, $email); |
|
62 | 62 | |
63 | 63 | echo $args['after_widget']; |
64 | 64 | } |
@@ -70,39 +70,39 @@ discard block |
||
70 | 70 | * @param mixed $instance Instance. |
71 | 71 | * @return void |
72 | 72 | */ |
73 | - public function form( $instance ) { |
|
73 | + public function form($instance) { |
|
74 | 74 | |
75 | 75 | // Set default values. |
76 | - $instance = wp_parse_args( (array) $instance, array( |
|
76 | + $instance = wp_parse_args((array) $instance, array( |
|
77 | 77 | 'title' => '', |
78 | 78 | 'screenname' => '', |
79 | 79 | 'zuid' => '', |
80 | 80 | )); |
81 | 81 | |
82 | 82 | // Retrieve an existing value from the database. |
83 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
84 | - $screenname = ! empty( $instance['screenname'] ) ? $instance['screenname'] : ''; |
|
85 | - $zuid = ! empty( $instance['zuid'] ) ? $instance['zuid'] : ''; |
|
86 | - $size = ! empty( $instance['size'] ) ? $instance['size'] : ''; |
|
87 | - $height = ! empty( $instance['height'] ) ? $instance['height'] : ''; |
|
88 | - $width = ! empty( $instance['width'] ) ? $instance['width'] : ''; |
|
83 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
84 | + $screenname = ! empty($instance['screenname']) ? $instance['screenname'] : ''; |
|
85 | + $zuid = ! empty($instance['zuid']) ? $instance['zuid'] : ''; |
|
86 | + $size = ! empty($instance['size']) ? $instance['size'] : ''; |
|
87 | + $height = ! empty($instance['height']) ? $instance['height'] : ''; |
|
88 | + $width = ! empty($instance['width']) ? $instance['width'] : ''; |
|
89 | 89 | |
90 | 90 | // Title. |
91 | 91 | echo '<p>'; |
92 | - echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>'; |
|
93 | - echo ' <input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title . '" class="widefat">'; |
|
92 | + echo ' <label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>'; |
|
93 | + echo ' <input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">'; |
|
94 | 94 | echo '</p>'; |
95 | 95 | |
96 | 96 | // Zillow Screenname. |
97 | 97 | echo '<p>'; |
98 | - echo ' <label for="' . $this->get_field_id( 'screenname' ) . '" class="title-label">' . __( 'Zillow Screenname:', 're-pro' ) . '</label>'; |
|
99 | - echo ' <input id="' . $this->get_field_id( 'screenname' ) . '" name="' . $this->get_field_name( 'screenname' ) . '" value="' . $screenname . '" class="widefat">'; |
|
98 | + echo ' <label for="' . $this->get_field_id('screenname') . '" class="title-label">' . __('Zillow Screenname:', 're-pro') . '</label>'; |
|
99 | + echo ' <input id="' . $this->get_field_id('screenname') . '" name="' . $this->get_field_name('screenname') . '" value="' . $screenname . '" class="widefat">'; |
|
100 | 100 | echo '</p>'; |
101 | 101 | |
102 | 102 | // Zillow User ID. |
103 | 103 | echo '<p>'; |
104 | - echo ' <label for="' . $this->get_field_id( 'zuid' ) . '" class="title-label">' . __( 'Zillow User ID:', 're-pro' ) . '</label>'; |
|
105 | - echo ' <input id="' . $this->get_field_id( 'zuid' ) . '" name="' . $this->get_field_name( 'zuid' ) . '" value="' . $zuid . '" class="widefat">'; |
|
104 | + echo ' <label for="' . $this->get_field_id('zuid') . '" class="title-label">' . __('Zillow User ID:', 're-pro') . '</label>'; |
|
105 | + echo ' <input id="' . $this->get_field_id('zuid') . '" name="' . $this->get_field_name('zuid') . '" value="' . $zuid . '" class="widefat">'; |
|
106 | 106 | echo '</p>'; |
107 | 107 | |
108 | 108 | } |
@@ -115,14 +115,14 @@ discard block |
||
115 | 115 | * @param mixed $old_instance Old Instance. |
116 | 116 | * @return $instance |
117 | 117 | */ |
118 | - public function update( $new_instance, $old_instance ) { |
|
118 | + public function update($new_instance, $old_instance) { |
|
119 | 119 | |
120 | 120 | $instance = $old_instance; |
121 | 121 | |
122 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
123 | - $instance['screenname'] = ! empty( $new_instance['screenname'] ) ? strip_tags( $new_instance['screenname'] ) : ''; |
|
124 | - $instance['zuid'] = ! empty( $new_instance['zuid'] ) ? strip_tags( $new_instance['zuid'] ) : ''; |
|
125 | - $instance['zmod'] = ! empty( $new_instance['zmod'] ) ? strip_tags( $new_instance['zmod'] ) : ''; |
|
122 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
123 | + $instance['screenname'] = ! empty($new_instance['screenname']) ? strip_tags($new_instance['screenname']) : ''; |
|
124 | + $instance['zuid'] = ! empty($new_instance['zuid']) ? strip_tags($new_instance['zuid']) : ''; |
|
125 | + $instance['zmod'] = ! empty($new_instance['zmod']) ? strip_tags($new_instance['zmod']) : ''; |
|
126 | 126 | return $instance; |
127 | 127 | } |
128 | 128 | } |
@@ -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'); |