@@ -6,27 +6,27 @@ |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | // Exit if accessed directly. |
9 | -if ( ! defined( 'ABSPATH' ) ) { exit; } |
|
9 | +if ( ! defined('ABSPATH')) { exit; } |
|
10 | 10 | |
11 | -include( 'widgets/class-homes-com-widgets.php' ); |
|
11 | +include('widgets/class-homes-com-widgets.php'); |
|
12 | 12 | |
13 | 13 | // Include Commute Time Widget. |
14 | -include( 'widgets/class-commute-time-widget.php' ); |
|
14 | +include('widgets/class-commute-time-widget.php'); |
|
15 | 15 | |
16 | 16 | // Include Featured Listings Widget. |
17 | -include( 'widgets/class-featured-listings-widget.php' ); |
|
17 | +include('widgets/class-featured-listings-widget.php'); |
|
18 | 18 | |
19 | 19 | // Include Home Values Widget. |
20 | -include( 'widgets/class-home-values-widget.php' ); |
|
20 | +include('widgets/class-home-values-widget.php'); |
|
21 | 21 | |
22 | 22 | // Include Search Widget. |
23 | -include( 'widgets/class-search-widget.php' ); |
|
23 | +include('widgets/class-search-widget.php'); |
|
24 | 24 | |
25 | 25 | // Include Mortgage Calculator Widget. |
26 | -include( 'widgets/class-mortgage-calculator-widget.php' ); |
|
26 | +include('widgets/class-mortgage-calculator-widget.php'); |
|
27 | 27 | |
28 | 28 | // Include Simple Search Widget. |
29 | -include( 'widgets/class-simple-search-widget.php' ); |
|
29 | +include('widgets/class-simple-search-widget.php'); |
|
30 | 30 | |
31 | 31 | // Include Tall Search Widget. |
32 | -include( 'widgets/class-tall-search-widget.php' ); |
|
32 | +include('widgets/class-tall-search-widget.php'); |
@@ -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 | * StreetAdvisor_Details class. |
@@ -20,9 +20,9 @@ discard block |
||
20 | 20 | |
21 | 21 | parent::__construct( |
22 | 22 | 'streetadvisor-reviews', |
23 | - __( 'Street Advisor - Location Reviews', 're-pro' ), |
|
23 | + __('Street Advisor - Location Reviews', 're-pro'), |
|
24 | 24 | array( |
25 | - 'description' => __( 'Street Advisor Location Reviews', 're-pro' ), |
|
25 | + 'description' => __('Street Advisor Location Reviews', 're-pro'), |
|
26 | 26 | ) |
27 | 27 | ); |
28 | 28 | |
@@ -36,17 +36,17 @@ discard block |
||
36 | 36 | * @param mixed $instance |
37 | 37 | * @return void |
38 | 38 | */ |
39 | - public function widget( $args, $instance ) { |
|
39 | + public function widget($args, $instance) { |
|
40 | 40 | |
41 | 41 | // Retrieve an existing value from the database |
42 | - $latitude = !empty( $instance['latitude'] ) ? $instance['latitude'] : ''; |
|
43 | - $longitude = !empty( $instance['longitude'] ) ? $instance['longitude'] : ''; |
|
44 | - $level = !empty( $instance['level'] ) ? $instance['level'] : ''; |
|
45 | - $title = !empty( $instance['title'] ) ? $instance['title'] : ''; |
|
42 | + $latitude = ! empty($instance['latitude']) ? $instance['latitude'] : ''; |
|
43 | + $longitude = ! empty($instance['longitude']) ? $instance['longitude'] : ''; |
|
44 | + $level = ! empty($instance['level']) ? $instance['level'] : ''; |
|
45 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
46 | 46 | |
47 | - $streetadvisor = new StreetAdvisorAPI( 'b08f6473-8dee-41c3-9a3e-b32f335e9d2d' ); |
|
47 | + $streetadvisor = new StreetAdvisorAPI('b08f6473-8dee-41c3-9a3e-b32f335e9d2d'); |
|
48 | 48 | |
49 | -$reviews = $streetadvisor->get_location_reviews( $latitude, $longitude, $level ); |
|
49 | +$reviews = $streetadvisor->get_location_reviews($latitude, $longitude, $level); |
|
50 | 50 | |
51 | 51 | // var_dump($reviews); |
52 | 52 | /* |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | echo $args['before_widget']; |
66 | 66 | |
67 | -echo $args['before_title'] . esc_attr( $title ) . $args['after_title']; |
|
67 | +echo $args['before_title'] . esc_attr($title) . $args['after_title']; |
|
68 | 68 | |
69 | 69 | foreach ($reviews['Items'] as $review) { |
70 | 70 | |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | echo '<div class="review" itemprop="review" itemscope itemtype="https://schema.org/Review">'; |
83 | 83 | |
84 | 84 | // echo '<img src="'. $user_avatar_url .'">'; |
85 | - echo '<span itemprop="reviewRating">'.$rating.'</span> stars - <strong>"<span itemprop="name">' . $title . '</span>"</strong> |
|
86 | - <br /> by <span itemprop="author">'.$user_displayname.'</span><br /> |
|
87 | - Written on <meta itemprop="datePublished" content="' .$date .'">'.$date .' |
|
88 | - <br /><span itemprop="reviewBody">'.$content.'</span>'; |
|
85 | + echo '<span itemprop="reviewRating">' . $rating . '</span> stars - <strong>"<span itemprop="name">' . $title . '</span>"</strong> |
|
86 | + <br /> by <span itemprop="author">'.$user_displayname . '</span><br /> |
|
87 | + Written on <meta itemprop="datePublished" content="' .$date . '">' . $date . ' |
|
88 | + <br /><span itemprop="reviewBody">'.$content . '</span>'; |
|
89 | 89 | |
90 | 90 | // echo '<small>'.$legal . '</small>'; |
91 | 91 | |
@@ -108,46 +108,46 @@ discard block |
||
108 | 108 | * @param mixed $instance |
109 | 109 | * @return void |
110 | 110 | */ |
111 | - public function form( $instance ) { |
|
111 | + public function form($instance) { |
|
112 | 112 | |
113 | 113 | // Set default values |
114 | - $instance = wp_parse_args( (array) $instance, array( |
|
114 | + $instance = wp_parse_args((array) $instance, array( |
|
115 | 115 | 'latitude' => '', |
116 | 116 | 'longitude' => '', |
117 | 117 | 'level' => '', |
118 | 118 | 'title' => '', |
119 | - ) ); |
|
119 | + )); |
|
120 | 120 | |
121 | 121 | // Retrieve an existing value from the database |
122 | - $latitude = !empty( $instance['latitude'] ) ? $instance['latitude'] : ''; |
|
123 | - $longitude = !empty( $instance['longitude'] ) ? $instance['longitude'] : ''; |
|
124 | - $level = !empty( $instance['level'] ) ? $instance['level'] : ''; |
|
125 | - $title = !empty( $instance['title'] ) ? $instance['title'] : ''; |
|
122 | + $latitude = ! empty($instance['latitude']) ? $instance['latitude'] : ''; |
|
123 | + $longitude = ! empty($instance['longitude']) ? $instance['longitude'] : ''; |
|
124 | + $level = ! empty($instance['level']) ? $instance['level'] : ''; |
|
125 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
126 | 126 | |
127 | 127 | // Form fields |
128 | 128 | echo '<p>'; |
129 | - echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title_label">' . __( 'Title', 're-pro' ) . '</label>'; |
|
130 | - echo ' <input type="text" id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" class="widefat" placeholder="' . esc_attr__( '', 're-pro' ) . '" value="' . esc_attr( $title ) . '">'; |
|
131 | - echo ' <span class="description">' . __( 'Title', 're-pro' ) . '</span>'; |
|
129 | + echo ' <label for="' . $this->get_field_id('title') . '" class="title_label">' . __('Title', 're-pro') . '</label>'; |
|
130 | + echo ' <input type="text" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" class="widefat" placeholder="' . esc_attr__('', 're-pro') . '" value="' . esc_attr($title) . '">'; |
|
131 | + echo ' <span class="description">' . __('Title', 're-pro') . '</span>'; |
|
132 | 132 | echo '</p>'; |
133 | 133 | |
134 | 134 | |
135 | 135 | echo '<p>'; |
136 | - echo ' <label for="' . $this->get_field_id( 'latitude' ) . '" class="latitude_label">' . __( 'Latitude', 're-pro' ) . '</label>'; |
|
137 | - echo ' <input type="text" id="' . $this->get_field_id( 'latitude' ) . '" name="' . $this->get_field_name( 'latitude' ) . '" class="widefat" placeholder="' . esc_attr__( '', 're-pro' ) . '" value="' . esc_attr( $latitude ) . '">'; |
|
138 | - echo ' <span class="description">' . __( 'Latitude', 're-pro' ) . '</span>'; |
|
136 | + echo ' <label for="' . $this->get_field_id('latitude') . '" class="latitude_label">' . __('Latitude', 're-pro') . '</label>'; |
|
137 | + echo ' <input type="text" id="' . $this->get_field_id('latitude') . '" name="' . $this->get_field_name('latitude') . '" class="widefat" placeholder="' . esc_attr__('', 're-pro') . '" value="' . esc_attr($latitude) . '">'; |
|
138 | + echo ' <span class="description">' . __('Latitude', 're-pro') . '</span>'; |
|
139 | 139 | echo '</p>'; |
140 | 140 | |
141 | 141 | echo '<p>'; |
142 | - echo ' <label for="' . $this->get_field_id( 'longitude' ) . '" class="longitude_label">' . __( 'Longitude', 're-pro' ) . '</label>'; |
|
143 | - echo ' <input type="text" id="' . $this->get_field_id( 'longitude' ) . '" name="' . $this->get_field_name( 'longitude' ) . '" class="widefat" placeholder="' . esc_attr__( '', 're-pro' ) . '" value="' . esc_attr( $longitude ) . '">'; |
|
144 | - echo ' <span class="description">' . __( 'Longitude', 're-pro' ) . '</span>'; |
|
142 | + echo ' <label for="' . $this->get_field_id('longitude') . '" class="longitude_label">' . __('Longitude', 're-pro') . '</label>'; |
|
143 | + echo ' <input type="text" id="' . $this->get_field_id('longitude') . '" name="' . $this->get_field_name('longitude') . '" class="widefat" placeholder="' . esc_attr__('', 're-pro') . '" value="' . esc_attr($longitude) . '">'; |
|
144 | + echo ' <span class="description">' . __('Longitude', 're-pro') . '</span>'; |
|
145 | 145 | echo '</p>'; |
146 | 146 | |
147 | 147 | echo '<p>'; |
148 | - echo ' <label for="' . $this->get_field_id( 'level' ) . '" class="level_label">' . __( 'Level', 're-pro' ) . '</label>'; |
|
149 | - echo ' <input type="number" id="' . $this->get_field_id( 'level' ) . '" name="' . $this->get_field_name( 'level' ) . '" class="widefat" placeholder="' . esc_attr__( '', 're-pro' ) . '" value="' . esc_attr( $level ) . '">'; |
|
150 | - echo ' <span class="description">' . __( 'Level', 're-pro' ) . '</span>'; |
|
148 | + echo ' <label for="' . $this->get_field_id('level') . '" class="level_label">' . __('Level', 're-pro') . '</label>'; |
|
149 | + echo ' <input type="number" id="' . $this->get_field_id('level') . '" name="' . $this->get_field_name('level') . '" class="widefat" placeholder="' . esc_attr__('', 're-pro') . '" value="' . esc_attr($level) . '">'; |
|
150 | + echo ' <span class="description">' . __('Level', 're-pro') . '</span>'; |
|
151 | 151 | echo '</p>'; |
152 | 152 | |
153 | 153 | |
@@ -162,14 +162,14 @@ discard block |
||
162 | 162 | * @param mixed $old_instance |
163 | 163 | * @return void |
164 | 164 | */ |
165 | - public function update( $new_instance, $old_instance ) { |
|
165 | + public function update($new_instance, $old_instance) { |
|
166 | 166 | |
167 | 167 | $instance = $old_instance; |
168 | 168 | |
169 | - $instance['latitude'] = !empty( $new_instance['latitude'] ) ? strip_tags( $new_instance['latitude'] ) : ''; |
|
170 | - $instance['longitude'] = !empty( $new_instance['longitude'] ) ? strip_tags( $new_instance['longitude'] ) : ''; |
|
171 | - $instance['level'] = !empty( $new_instance['level'] ) ? strip_tags( $new_instance['level'] ) : ''; |
|
172 | - $instance['title'] = !empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
169 | + $instance['latitude'] = ! empty($new_instance['latitude']) ? strip_tags($new_instance['latitude']) : ''; |
|
170 | + $instance['longitude'] = ! empty($new_instance['longitude']) ? strip_tags($new_instance['longitude']) : ''; |
|
171 | + $instance['level'] = ! empty($new_instance['level']) ? strip_tags($new_instance['level']) : ''; |
|
172 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
173 | 173 | |
174 | 174 | return $instance; |
175 | 175 | |
@@ -184,6 +184,6 @@ discard block |
||
184 | 184 | * @return void |
185 | 185 | */ |
186 | 186 | function streetadvisor_register_widgets() { |
187 | - register_widget( 'StreetAdvisor_Reviews' ); |
|
187 | + register_widget('StreetAdvisor_Reviews'); |
|
188 | 188 | } |
189 | -add_action( 'widgets_init', 'streetadvisor_register_widgets' ); |
|
189 | +add_action('widgets_init', 'streetadvisor_register_widgets'); |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /* Exit if accessed directly */ |
4 | -if ( ! defined( 'ABSPATH' ) ) { exit; } |
|
4 | +if ( ! defined('ABSPATH')) { exit; } |
|
5 | 5 | |
6 | 6 | /** |
7 | 7 | * StreetAdvisor_Details class. |
@@ -20,9 +20,9 @@ discard block |
||
20 | 20 | |
21 | 21 | parent::__construct( |
22 | 22 | 'streetadvisor-details', |
23 | - __( 'Street Advisor - Location Details', 're-pro' ), |
|
23 | + __('Street Advisor - Location Details', 're-pro'), |
|
24 | 24 | array( |
25 | - 'description' => __( 'Street Advisor Location Details', 're-pro' ), |
|
25 | + 'description' => __('Street Advisor Location Details', 're-pro'), |
|
26 | 26 | ) |
27 | 27 | ); |
28 | 28 | |
@@ -36,23 +36,23 @@ discard block |
||
36 | 36 | * @param mixed $instance |
37 | 37 | * @return void |
38 | 38 | */ |
39 | - public function widget( $args, $instance ) { |
|
39 | + public function widget($args, $instance) { |
|
40 | 40 | |
41 | 41 | // Retrieve an existing value from the database |
42 | - $latitude = !empty( $instance['latitude'] ) ? $instance['latitude'] : ''; |
|
43 | - $longitude = !empty( $instance['longitude'] ) ? $instance['longitude'] : ''; |
|
44 | - $level = !empty( $instance['level'] ) ? $instance['level'] : ''; |
|
45 | - $title = !empty( $instance['title'] ) ? $instance['title'] : ''; |
|
42 | + $latitude = ! empty($instance['latitude']) ? $instance['latitude'] : ''; |
|
43 | + $longitude = ! empty($instance['longitude']) ? $instance['longitude'] : ''; |
|
44 | + $level = ! empty($instance['level']) ? $instance['level'] : ''; |
|
45 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
46 | 46 | |
47 | - $streetadvisor = new StreetAdvisorAPI( 'b08f6473-8dee-41c3-9a3e-b32f335e9d2d' ); |
|
47 | + $streetadvisor = new StreetAdvisorAPI('b08f6473-8dee-41c3-9a3e-b32f335e9d2d'); |
|
48 | 48 | |
49 | -$location = $streetadvisor->get_location_data( $latitude, $longitude, $level ); |
|
49 | +$location = $streetadvisor->get_location_data($latitude, $longitude, $level); |
|
50 | 50 | |
51 | 51 | $name = $location['Location']['Name']; |
52 | 52 | $ranking_description = $location['Location']['RankingDescription']; |
53 | 53 | $score = $location['Location']['Score']; |
54 | -$photo_url = esc_url( apply_filters( 'jetpack_photon_url', $location['Location']['PhotoUrl'] ) ); |
|
55 | -$streetadvisor_url = esc_url( $location['Location']['Url'] ); // Lets force HTTPS for this please ! |
|
54 | +$photo_url = esc_url(apply_filters('jetpack_photon_url', $location['Location']['PhotoUrl'])); |
|
55 | +$streetadvisor_url = esc_url($location['Location']['Url']); // Lets force HTTPS for this please ! |
|
56 | 56 | |
57 | 57 | $recommendations_greatfor = $location['Recommendations']['GreatFor']; |
58 | 58 | $recommendations_notgreatfor = $location['Recommendations']['NotGreatFor']; |
@@ -61,20 +61,20 @@ discard block |
||
61 | 61 | |
62 | 62 | echo $args['before_widget']; |
63 | 63 | |
64 | -echo $args['before_title'] . esc_attr( $title ) . $args['after_title']; |
|
64 | +echo $args['before_title'] . esc_attr($title) . $args['after_title']; |
|
65 | 65 | |
66 | 66 | echo '<style>.sa-column{width:100%;float:left;display:inline-block;}.streetadvisor-list{margin: 10px 0;}.streetadvisor-list li {list-style-type:circle !important;margin:0;padding:0;list-style-position: inside;}</style>'; |
67 | 67 | |
68 | -echo '<img id="" class="" src="'.$photo_url.'" srcset="" sizes="" alt="'. $name .'" height="" width="">'; |
|
68 | +echo '<img id="" class="" src="' . $photo_url . '" srcset="" sizes="" alt="' . $name . '" height="" width="">'; |
|
69 | 69 | |
70 | 70 | |
71 | -echo '<p>' . $name . ' has a score of <strong>' . $score . ' out of 10</strong> on <a href="'. $streetadvisor_url .'" rel="nofollow">StreetAdvisor</a>. '. $ranking_description .'</p>'; |
|
71 | +echo '<p>' . $name . ' has a score of <strong>' . $score . ' out of 10</strong> on <a href="' . $streetadvisor_url . '" rel="nofollow">StreetAdvisor</a>. ' . $ranking_description . '</p>'; |
|
72 | 72 | |
73 | 73 | echo '<div class="sa-column">'; |
74 | 74 | |
75 | 75 | echo '<strong>Great For:</strong>'; |
76 | 76 | echo '<ul class="re-pro streetadvisor-list streetadvisor-great-for">'; |
77 | -foreach($recommendations_greatfor as $greatfor_item) { |
|
77 | +foreach ($recommendations_greatfor as $greatfor_item) { |
|
78 | 78 | echo '<li>' . $greatfor_item . '</li>'; |
79 | 79 | } |
80 | 80 | echo '</ul>'; |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | echo '<div class="sa-column">'; |
84 | 84 | echo '<strong>Not Great For:</strong>'; |
85 | 85 | echo '<ul class="re-pro streetadvisor-list streetadvisor-not-great-for">'; |
86 | -foreach($recommendations_notgreatfor as $notgreatfor_item) { |
|
86 | +foreach ($recommendations_notgreatfor as $notgreatfor_item) { |
|
87 | 87 | echo '<li>' . $notgreatfor_item . '</li>'; |
88 | 88 | } |
89 | 89 | echo '</ul>'; |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | echo '<div class="sa-column">'; |
93 | 93 | echo '<strong>Who Lives Here:</strong>'; |
94 | 94 | echo '<ul class="re-pro streetadvisor-list streetadvisor-who-lives-here">'; |
95 | -foreach($recommendations_wholiveshere as $wholiveshere_item) { |
|
95 | +foreach ($recommendations_wholiveshere as $wholiveshere_item) { |
|
96 | 96 | echo '<li>' . $wholiveshere_item . '</li>'; |
97 | 97 | } |
98 | 98 | echo '</ul>'; |
@@ -109,45 +109,45 @@ discard block |
||
109 | 109 | * @param mixed $instance |
110 | 110 | * @return void |
111 | 111 | */ |
112 | - public function form( $instance ) { |
|
112 | + public function form($instance) { |
|
113 | 113 | |
114 | 114 | // Set default values |
115 | - $instance = wp_parse_args( (array) $instance, array( |
|
115 | + $instance = wp_parse_args((array) $instance, array( |
|
116 | 116 | 'latitude' => '', |
117 | 117 | 'longitude' => '', |
118 | 118 | 'level' => '', |
119 | 119 | 'title' => '', |
120 | - ) ); |
|
120 | + )); |
|
121 | 121 | |
122 | 122 | // Retrieve an existing value from the database |
123 | - $latitude = !empty( $instance['latitude'] ) ? $instance['latitude'] : ''; |
|
124 | - $longitude = !empty( $instance['longitude'] ) ? $instance['longitude'] : ''; |
|
125 | - $level = !empty( $instance['level'] ) ? $instance['level'] : ''; |
|
126 | - $title = !empty( $instance['title'] ) ? $instance['title'] : ''; |
|
123 | + $latitude = ! empty($instance['latitude']) ? $instance['latitude'] : ''; |
|
124 | + $longitude = ! empty($instance['longitude']) ? $instance['longitude'] : ''; |
|
125 | + $level = ! empty($instance['level']) ? $instance['level'] : ''; |
|
126 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
127 | 127 | |
128 | 128 | // Form fields |
129 | 129 | echo '<p>'; |
130 | - echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title_label">' . __( 'Title', 're-pro' ) . '</label>'; |
|
131 | - echo ' <input type="text" id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" class="widefat" placeholder="' . esc_attr__( '', 're-pro' ) . '" value="' . esc_attr( $title ) . '">'; |
|
132 | - echo ' <span class="description">' . __( 'Title', 're-pro' ) . '</span>'; |
|
130 | + echo ' <label for="' . $this->get_field_id('title') . '" class="title_label">' . __('Title', 're-pro') . '</label>'; |
|
131 | + echo ' <input type="text" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" class="widefat" placeholder="' . esc_attr__('', 're-pro') . '" value="' . esc_attr($title) . '">'; |
|
132 | + echo ' <span class="description">' . __('Title', 're-pro') . '</span>'; |
|
133 | 133 | echo '</p>'; |
134 | 134 | |
135 | 135 | echo '<p>'; |
136 | - echo ' <label for="' . $this->get_field_id( 'latitude' ) . '" class="latitude_label">' . __( 'Latitude', 're-pro' ) . '</label>'; |
|
137 | - echo ' <input type="text" id="' . $this->get_field_id( 'latitude' ) . '" name="' . $this->get_field_name( 'latitude' ) . '" class="widefat" placeholder="' . esc_attr__( '', 're-pro' ) . '" value="' . esc_attr( $latitude ) . '">'; |
|
138 | - echo ' <span class="description">' . __( 'Latitude', 're-pro' ) . '</span>'; |
|
136 | + echo ' <label for="' . $this->get_field_id('latitude') . '" class="latitude_label">' . __('Latitude', 're-pro') . '</label>'; |
|
137 | + echo ' <input type="text" id="' . $this->get_field_id('latitude') . '" name="' . $this->get_field_name('latitude') . '" class="widefat" placeholder="' . esc_attr__('', 're-pro') . '" value="' . esc_attr($latitude) . '">'; |
|
138 | + echo ' <span class="description">' . __('Latitude', 're-pro') . '</span>'; |
|
139 | 139 | echo '</p>'; |
140 | 140 | |
141 | 141 | echo '<p>'; |
142 | - echo ' <label for="' . $this->get_field_id( 'longitude' ) . '" class="longitude_label">' . __( 'Longitude', 're-pro' ) . '</label>'; |
|
143 | - echo ' <input type="text" id="' . $this->get_field_id( 'longitude' ) . '" name="' . $this->get_field_name( 'longitude' ) . '" class="widefat" placeholder="' . esc_attr__( '', 're-pro' ) . '" value="' . esc_attr( $longitude ) . '">'; |
|
144 | - echo ' <span class="description">' . __( 'Longitude', 're-pro' ) . '</span>'; |
|
142 | + echo ' <label for="' . $this->get_field_id('longitude') . '" class="longitude_label">' . __('Longitude', 're-pro') . '</label>'; |
|
143 | + echo ' <input type="text" id="' . $this->get_field_id('longitude') . '" name="' . $this->get_field_name('longitude') . '" class="widefat" placeholder="' . esc_attr__('', 're-pro') . '" value="' . esc_attr($longitude) . '">'; |
|
144 | + echo ' <span class="description">' . __('Longitude', 're-pro') . '</span>'; |
|
145 | 145 | echo '</p>'; |
146 | 146 | |
147 | 147 | echo '<p>'; |
148 | - echo ' <label for="' . $this->get_field_id( 'level' ) . '" class="level_label">' . __( 'Level', 're-pro' ) . '</label>'; |
|
149 | - echo ' <input type="number" id="' . $this->get_field_id( 'level' ) . '" name="' . $this->get_field_name( 'level' ) . '" class="widefat" placeholder="' . esc_attr__( '', 're-pro' ) . '" value="' . esc_attr( $level ) . '" step="1" min="0" max="50">'; |
|
150 | - echo ' <span class="description">' . __( 'Level', 're-pro' ) . '</span>'; |
|
148 | + echo ' <label for="' . $this->get_field_id('level') . '" class="level_label">' . __('Level', 're-pro') . '</label>'; |
|
149 | + echo ' <input type="number" id="' . $this->get_field_id('level') . '" name="' . $this->get_field_name('level') . '" class="widefat" placeholder="' . esc_attr__('', 're-pro') . '" value="' . esc_attr($level) . '" step="1" min="0" max="50">'; |
|
150 | + echo ' <span class="description">' . __('Level', 're-pro') . '</span>'; |
|
151 | 151 | echo '</p>'; |
152 | 152 | |
153 | 153 | |
@@ -163,14 +163,14 @@ discard block |
||
163 | 163 | * @param mixed $old_instance |
164 | 164 | * @return void |
165 | 165 | */ |
166 | - public function update( $new_instance, $old_instance ) { |
|
166 | + public function update($new_instance, $old_instance) { |
|
167 | 167 | |
168 | 168 | $instance = $old_instance; |
169 | 169 | |
170 | - $instance['latitude'] = !empty( $new_instance['latitude'] ) ? strip_tags( $new_instance['latitude'] ) : ''; |
|
171 | - $instance['longitude'] = !empty( $new_instance['longitude'] ) ? strip_tags( $new_instance['longitude'] ) : ''; |
|
172 | - $instance['level'] = !empty( $new_instance['level'] ) ? strip_tags( $new_instance['level'] ) : ''; |
|
173 | - $instance['title'] = !empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
170 | + $instance['latitude'] = ! empty($new_instance['latitude']) ? strip_tags($new_instance['latitude']) : ''; |
|
171 | + $instance['longitude'] = ! empty($new_instance['longitude']) ? strip_tags($new_instance['longitude']) : ''; |
|
172 | + $instance['level'] = ! empty($new_instance['level']) ? strip_tags($new_instance['level']) : ''; |
|
173 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
174 | 174 | |
175 | 175 | return $instance; |
176 | 176 | |
@@ -185,6 +185,6 @@ discard block |
||
185 | 185 | * @return void |
186 | 186 | */ |
187 | 187 | function register_widgets() { |
188 | - register_widget( 'StreetAdvisor_Details' ); |
|
188 | + register_widget('StreetAdvisor_Details'); |
|
189 | 189 | } |
190 | -add_action( 'widgets_init', 'register_widgets' ); |
|
190 | +add_action('widgets_init', 'register_widgets'); |
@@ -6,10 +6,10 @@ |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | /* Exit if accessed directly. */ |
9 | -if ( ! defined( 'ABSPATH' ) ) { exit; } |
|
9 | +if ( ! defined('ABSPATH')) { exit; } |
|
10 | 10 | |
11 | -include( 'wp-streetadvisor-api.php' ); |
|
11 | +include('wp-streetadvisor-api.php'); |
|
12 | 12 | |
13 | -include( 'widgets/streetadvisor-details.php' ); |
|
13 | +include('widgets/streetadvisor-details.php'); |
|
14 | 14 | |
15 | 15 | // include( 'widgets/streetadvisor-reviews.php' ); |
@@ -6,44 +6,44 @@ discard block |
||
6 | 6 | |
7 | 7 | parent::__construct( |
8 | 8 | 'getschools', |
9 | - __( 'GreatSchools - Get List of Schools', 're-pro' ), |
|
9 | + __('GreatSchools - Get List of Schools', 're-pro'), |
|
10 | 10 | array( |
11 | - 'description' => __( 'Get Schools', 're-pro' ), |
|
11 | + 'description' => __('Get Schools', 're-pro'), |
|
12 | 12 | ) |
13 | 13 | ); |
14 | 14 | |
15 | 15 | } |
16 | 16 | |
17 | - public function widget( $args, $instance ) { |
|
17 | + public function widget($args, $instance) { |
|
18 | 18 | |
19 | - $greatschools_title = !empty( $instance['greatschools_title'] ) ? $instance['greatschools_title'] : ''; |
|
20 | - $greatschools_state = !empty( $instance['greatschools_state'] ) ? $instance['greatschools_state'] : ''; |
|
21 | - $greatschools_city = !empty( $instance['greatschools_city'] ) ? $instance['greatschools_city'] : ''; |
|
19 | + $greatschools_title = ! empty($instance['greatschools_title']) ? $instance['greatschools_title'] : ''; |
|
20 | + $greatschools_state = ! empty($instance['greatschools_state']) ? $instance['greatschools_state'] : ''; |
|
21 | + $greatschools_city = ! empty($instance['greatschools_city']) ? $instance['greatschools_city'] : ''; |
|
22 | 22 | |
23 | 23 | // Call our API. |
24 | - $greatschools = new GreatSchoolsAPI( '' ); |
|
25 | - $schools = $greatschools->get_schools($greatschools_state,$greatschools_city); |
|
24 | + $greatschools = new GreatSchoolsAPI(''); |
|
25 | + $schools = $greatschools->get_schools($greatschools_state, $greatschools_city); |
|
26 | 26 | |
27 | 27 | |
28 | 28 | |
29 | 29 | echo $args['before_widget']; |
30 | 30 | |
31 | - echo $args['before_title'] . esc_attr( $greatschools_title ) . $args['after_title']; |
|
31 | + echo $args['before_title'] . esc_attr($greatschools_title) . $args['after_title']; |
|
32 | 32 | |
33 | 33 | // var_dump($schools); |
34 | 34 | |
35 | - foreach($schools as $school) { |
|
35 | + foreach ($schools as $school) { |
|
36 | 36 | |
37 | - foreach($school as $school_item) { |
|
37 | + foreach ($school as $school_item) { |
|
38 | 38 | |
39 | 39 | $name = $school_item['name']; |
40 | - $type =$school_item['type']; |
|
40 | + $type = $school_item['type']; |
|
41 | 41 | $grade_range = $school_item['gradeRange']; |
42 | 42 | $state = $school_item['state']; |
43 | 43 | $city = $school_item['city']; |
44 | 44 | $overview_link = $school_item['overviewLink']; |
45 | 45 | |
46 | - echo '<li><a href="'.$overview_link.'" rel="nofollow">' . $name . '</a></li>'; |
|
46 | + echo '<li><a href="' . $overview_link . '" rel="nofollow">' . $name . '</a></li>'; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | |
@@ -53,48 +53,48 @@ discard block |
||
53 | 53 | |
54 | 54 | } |
55 | 55 | |
56 | - public function form( $instance ) { |
|
56 | + public function form($instance) { |
|
57 | 57 | |
58 | 58 | // Set default values |
59 | - $instance = wp_parse_args( (array) $instance, array( |
|
59 | + $instance = wp_parse_args((array) $instance, array( |
|
60 | 60 | 'greatschools_title' => '', |
61 | 61 | 'greatschools_state' => '', |
62 | 62 | 'greatschools_city' => '', |
63 | - ) ); |
|
63 | + )); |
|
64 | 64 | |
65 | 65 | // Retrieve an existing value from the database |
66 | - $greatschools_title = !empty( $instance['greatschools_title'] ) ? $instance['greatschools_title'] : ''; |
|
67 | - $greatschools_state = !empty( $instance['greatschools_state'] ) ? $instance['greatschools_state'] : ''; |
|
68 | - $greatschools_city = !empty( $instance['greatschools_city'] ) ? $instance['greatschools_city'] : ''; |
|
66 | + $greatschools_title = ! empty($instance['greatschools_title']) ? $instance['greatschools_title'] : ''; |
|
67 | + $greatschools_state = ! empty($instance['greatschools_state']) ? $instance['greatschools_state'] : ''; |
|
68 | + $greatschools_city = ! empty($instance['greatschools_city']) ? $instance['greatschools_city'] : ''; |
|
69 | 69 | |
70 | 70 | // Form fields |
71 | 71 | echo '<p>'; |
72 | - echo ' <label for="' . $this->get_field_id( 'greatschools_title' ) . '" class="greatschools_title_label">' . __( 'Title', 're-pro' ) . '</label>'; |
|
73 | - echo ' <input type="text" id="' . $this->get_field_id( 'greatschools_title' ) . '" name="' . $this->get_field_name( 'greatschools_title' ) . '" class="widefat" placeholder="' . esc_attr__( '', 're-pro' ) . '" value="' . esc_attr( $greatschools_title ) . '">'; |
|
74 | - echo ' <span class="description">' . __( 'Title', 're-pro' ) . '</span>'; |
|
72 | + echo ' <label for="' . $this->get_field_id('greatschools_title') . '" class="greatschools_title_label">' . __('Title', 're-pro') . '</label>'; |
|
73 | + echo ' <input type="text" id="' . $this->get_field_id('greatschools_title') . '" name="' . $this->get_field_name('greatschools_title') . '" class="widefat" placeholder="' . esc_attr__('', 're-pro') . '" value="' . esc_attr($greatschools_title) . '">'; |
|
74 | + echo ' <span class="description">' . __('Title', 're-pro') . '</span>'; |
|
75 | 75 | echo '</p>'; |
76 | 76 | |
77 | 77 | echo '<p>'; |
78 | - echo ' <label for="' . $this->get_field_id( 'greatschools_state' ) . '" class="greatschools_state_label">' . __( 'State', 're-pro' ) . '</label>'; |
|
79 | - echo ' <input type="text" id="' . $this->get_field_id( 'greatschools_state' ) . '" name="' . $this->get_field_name( 'greatschools_state' ) . '" class="widefat" placeholder="' . esc_attr__( '', 're-pro' ) . '" value="' . esc_attr( $greatschools_state ) . '">'; |
|
80 | - echo ' <span class="description">' . __( 'State', 're-pro' ) . '</span>'; |
|
78 | + echo ' <label for="' . $this->get_field_id('greatschools_state') . '" class="greatschools_state_label">' . __('State', 're-pro') . '</label>'; |
|
79 | + echo ' <input type="text" id="' . $this->get_field_id('greatschools_state') . '" name="' . $this->get_field_name('greatschools_state') . '" class="widefat" placeholder="' . esc_attr__('', 're-pro') . '" value="' . esc_attr($greatschools_state) . '">'; |
|
80 | + echo ' <span class="description">' . __('State', 're-pro') . '</span>'; |
|
81 | 81 | echo '</p>'; |
82 | 82 | |
83 | 83 | echo '<p>'; |
84 | - echo ' <label for="' . $this->get_field_id( 'greatschools_city' ) . '" class="greatschools_city_label">' . __( 'City', 're-pro' ) . '</label>'; |
|
85 | - echo ' <input type="text" id="' . $this->get_field_id( 'greatschools_city' ) . '" name="' . $this->get_field_name( 'greatschools_city' ) . '" class="widefat" placeholder="' . esc_attr__( '', 're-pro' ) . '" value="' . esc_attr( $greatschools_city ) . '">'; |
|
86 | - echo ' <span class="description">' . __( 'City', 're-pro' ) . '</span>'; |
|
84 | + echo ' <label for="' . $this->get_field_id('greatschools_city') . '" class="greatschools_city_label">' . __('City', 're-pro') . '</label>'; |
|
85 | + echo ' <input type="text" id="' . $this->get_field_id('greatschools_city') . '" name="' . $this->get_field_name('greatschools_city') . '" class="widefat" placeholder="' . esc_attr__('', 're-pro') . '" value="' . esc_attr($greatschools_city) . '">'; |
|
86 | + echo ' <span class="description">' . __('City', 're-pro') . '</span>'; |
|
87 | 87 | echo '</p>'; |
88 | 88 | |
89 | 89 | } |
90 | 90 | |
91 | - public function update( $new_instance, $old_instance ) { |
|
91 | + public function update($new_instance, $old_instance) { |
|
92 | 92 | |
93 | 93 | $instance = $old_instance; |
94 | 94 | |
95 | - $instance['greatschools_title'] = !empty( $new_instance['greatschools_title'] ) ? strip_tags( $new_instance['greatschools_title'] ) : ''; |
|
96 | - $instance['greatschools_state'] = !empty( $new_instance['greatschools_state'] ) ? strip_tags( $new_instance['greatschools_state'] ) : ''; |
|
97 | - $instance['greatschools_city'] = !empty( $new_instance['greatschools_city'] ) ? strip_tags( $new_instance['greatschools_city'] ) : ''; |
|
95 | + $instance['greatschools_title'] = ! empty($new_instance['greatschools_title']) ? strip_tags($new_instance['greatschools_title']) : ''; |
|
96 | + $instance['greatschools_state'] = ! empty($new_instance['greatschools_state']) ? strip_tags($new_instance['greatschools_state']) : ''; |
|
97 | + $instance['greatschools_city'] = ! empty($new_instance['greatschools_city']) ? strip_tags($new_instance['greatschools_city']) : ''; |
|
98 | 98 | |
99 | 99 | return $instance; |
100 | 100 | |
@@ -103,6 +103,6 @@ discard block |
||
103 | 103 | } |
104 | 104 | |
105 | 105 | function greatschools_register_widgets() { |
106 | - register_widget( 'greatschools_getschools' ); |
|
106 | + register_widget('greatschools_getschools'); |
|
107 | 107 | } |
108 | -add_action( 'widgets_init', 'greatschools_register_widgets' ); |
|
108 | +add_action('widgets_init', 'greatschools_register_widgets'); |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once( 'wp-greatschools-api.php' ); |
|
3 | +require_once('wp-greatschools-api.php'); |
|
4 | 4 | |
5 | 5 | // require_once( 'widgets/widget-getschools.php' ); |
@@ -1,6 +1,6 @@ |
||
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 | require_once('widgets/inman-news-widget.php'); |
@@ -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 | * Inman Feed Widget |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | |
28 | 28 | parent::__construct( |
29 | 29 | 'inman_news_widget', |
30 | - __( 'Inman News', 're-pro' ), |
|
30 | + __('Inman News', 're-pro'), |
|
31 | 31 | array( |
32 | - 'description' => __( 'Display the lastest news from Inman.', 're-pro' ), |
|
32 | + 'description' => __('Display the lastest news from Inman.', 're-pro'), |
|
33 | 33 | 'classname' => 're-pro re-pro-widget inman-widget inman-news-widget', |
34 | 34 | 'customize_selective_refresh' => true, |
35 | 35 | ) |
@@ -44,34 +44,34 @@ 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 | 49 | |
50 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
51 | - $display_total = ! empty( $instance['display_total'] ) ? $instance['display_total'] : '3'; |
|
50 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
51 | + $display_total = ! empty($instance['display_total']) ? $instance['display_total'] : '3'; |
|
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 | |
59 | - $rss = fetch_feed( 'https://feeds.feedburner.com/inmannews' ); |
|
59 | + $rss = fetch_feed('https://feeds.feedburner.com/inmannews'); |
|
60 | 60 | |
61 | 61 | |
62 | 62 | |
63 | - if( ! is_wp_error( $rss ) ) { |
|
63 | + if ( ! is_wp_error($rss)) { |
|
64 | 64 | |
65 | - $max_items = $rss->get_item_quantity( $display_total ); |
|
66 | - $rss_items = $rss->get_items( 0, $display_total ); |
|
65 | + $max_items = $rss->get_item_quantity($display_total); |
|
66 | + $rss_items = $rss->get_items(0, $display_total); |
|
67 | 67 | |
68 | 68 | // echo $rss->get_title(); |
69 | 69 | // echo '<small>'. $rss->get_description() . '.</small>'; |
70 | 70 | |
71 | - foreach( $rss_items as $item ) { |
|
71 | + foreach ($rss_items as $item) { |
|
72 | 72 | |
73 | 73 | echo '<div style="margin:20px 0;">'; |
74 | - echo '<h4><a href="'. $item->get_link() .'" rel="nofollow" target="_blank">' . $item->get_title() . '</a></h4>'; |
|
74 | + echo '<h4><a href="' . $item->get_link() . '" rel="nofollow" target="_blank">' . $item->get_title() . '</a></h4>'; |
|
75 | 75 | echo '</div>'; |
76 | 76 | |
77 | 77 | echo $item->get_content(); |
@@ -92,22 +92,22 @@ discard block |
||
92 | 92 | * @param mixed $instance Instance. |
93 | 93 | * @return void |
94 | 94 | */ |
95 | - public function form( $instance ) { |
|
95 | + public function form($instance) { |
|
96 | 96 | |
97 | 97 | // Set default values. |
98 | - $instance = wp_parse_args( (array) $instance, array( |
|
98 | + $instance = wp_parse_args((array) $instance, array( |
|
99 | 99 | 'title' => '', |
100 | 100 | |
101 | 101 | )); |
102 | 102 | |
103 | 103 | // Retrieve an existing value from the database. |
104 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
105 | - $display_total = ! empty( $instance['display_total'] ) ? $instance['display_total'] : ''; |
|
104 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
105 | + $display_total = ! empty($instance['display_total']) ? $instance['display_total'] : ''; |
|
106 | 106 | |
107 | 107 | // Title. |
108 | 108 | echo '<p>'; |
109 | - echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>'; |
|
110 | - echo ' <input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title . '" class="widefat">'; |
|
109 | + echo ' <label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>'; |
|
110 | + echo ' <input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">'; |
|
111 | 111 | echo '</p>'; |
112 | 112 | |
113 | 113 | // TODO: Add field to select display total count, 1 - 20. |
@@ -122,12 +122,12 @@ discard block |
||
122 | 122 | * @param mixed $old_instance Old Instance. |
123 | 123 | * @return $instance |
124 | 124 | */ |
125 | - public function update( $new_instance, $old_instance ) { |
|
125 | + public function update($new_instance, $old_instance) { |
|
126 | 126 | |
127 | 127 | $instance = $old_instance; |
128 | 128 | |
129 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
130 | - $instance['display_total'] = ! empty( $new_instance['display_total'] ) ? strip_tags( $new_instance['display_total'] ) : ''; |
|
129 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
130 | + $instance['display_total'] = ! empty($new_instance['display_total']) ? strip_tags($new_instance['display_total']) : ''; |
|
131 | 131 | |
132 | 132 | return $instance; |
133 | 133 | } |
@@ -141,6 +141,6 @@ discard block |
||
141 | 141 | */ |
142 | 142 | function repro_inman_news_widget() { |
143 | 143 | |
144 | - register_widget( 'InmanNewsWidget' ); |
|
144 | + register_widget('InmanNewsWidget'); |
|
145 | 145 | } |
146 | -add_action( 'widgets_init', 'repro_inman_news_widget' ); |
|
146 | +add_action('widgets_init', 'repro_inman_news_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 | * Trulia Feed Widget |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | |
28 | 28 | parent::__construct( |
29 | 29 | 'trulia_rss_listing_widget', |
30 | - __( 'Trulia Listings RSS', 're-pro' ), |
|
30 | + __('Trulia Listings RSS', 're-pro'), |
|
31 | 31 | array( |
32 | - 'description' => __( 'Display listings from Trulia via a RSS Feed.', 're-pro' ), |
|
32 | + 'description' => __('Display listings from Trulia via a RSS Feed.', 're-pro'), |
|
33 | 33 | 'classname' => 're-pro re-pro-widget trulia-widget trulia-rss-listings-widget', |
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'] : ''; |
|
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 | |
58 | - $rss = fetch_feed( get_trulia_rss_listing_feed( 'for_sale', 'Sacramento', 'CA' ) ); |
|
58 | + $rss = fetch_feed(get_trulia_rss_listing_feed('for_sale', 'Sacramento', 'CA')); |
|
59 | 59 | |
60 | 60 | /* Sometimes the feed has errors so we must use SimplePie ForceFeed. */ |
61 | - add_action('wp_feed_options', 'trulia_force_feed' , 10, 1); |
|
61 | + add_action('wp_feed_options', 'trulia_force_feed', 10, 1); |
|
62 | 62 | function trulia_force_feed($rss) { |
63 | 63 | |
64 | 64 | $rss->force_feed(true); |
@@ -66,24 +66,24 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | // echo get_trulia_rss_listing_feed( 'for_sale', 'Sacramento', 'CA'); |
69 | - if( ! is_wp_error( $rss ) ) { |
|
69 | + if ( ! is_wp_error($rss)) { |
|
70 | 70 | |
71 | 71 | $max_items = $rss->get_item_quantity(3); |
72 | - $rss_items = $rss->get_items(0,3); |
|
72 | + $rss_items = $rss->get_items(0, 3); |
|
73 | 73 | |
74 | 74 | // echo $rss->get_title(); |
75 | 75 | // echo $rss->get_description(); |
76 | 76 | |
77 | - foreach( $rss_items as $item ) { |
|
77 | + foreach ($rss_items as $item) { |
|
78 | 78 | |
79 | 79 | echo '<div style="margin:20px 0;">'; |
80 | - echo '<h4><a href="'. $item->get_link() .'" rel="nofollow" target="_blank">' . $item->get_title() . '</a></h4>'; |
|
80 | + echo '<h4><a href="' . $item->get_link() . '" rel="nofollow" target="_blank">' . $item->get_title() . '</a></h4>'; |
|
81 | 81 | echo '</div>'; |
82 | 82 | |
83 | 83 | echo $item->get_content(); |
84 | 84 | |
85 | 85 | echo '<div style="margin:20px 0;text-align:right;">'; |
86 | - echo '<small> Updated on '.$item->get_date('F j, Y') . '.</small>'; |
|
86 | + echo '<small> Updated on ' . $item->get_date('F j, Y') . '.</small>'; |
|
87 | 87 | echo '</div>'; |
88 | 88 | } |
89 | 89 | |
@@ -101,22 +101,22 @@ discard block |
||
101 | 101 | * @param mixed $instance Instance. |
102 | 102 | * @return void |
103 | 103 | */ |
104 | - public function form( $instance ) { |
|
104 | + public function form($instance) { |
|
105 | 105 | |
106 | 106 | // Set default values. |
107 | - $instance = wp_parse_args( (array) $instance, array( |
|
107 | + $instance = wp_parse_args((array) $instance, array( |
|
108 | 108 | 'title' => '', |
109 | 109 | |
110 | 110 | )); |
111 | 111 | |
112 | 112 | // Retrieve an existing value from the database. |
113 | - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
113 | + $title = ! empty($instance['title']) ? $instance['title'] : ''; |
|
114 | 114 | |
115 | 115 | |
116 | 116 | // Title. |
117 | 117 | echo '<p>'; |
118 | - echo ' <label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>'; |
|
119 | - echo ' <input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title . '" class="widefat">'; |
|
118 | + echo ' <label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>'; |
|
119 | + echo ' <input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">'; |
|
120 | 120 | echo '</p>'; |
121 | 121 | |
122 | 122 | |
@@ -130,11 +130,11 @@ discard block |
||
130 | 130 | * @param mixed $old_instance Old Instance. |
131 | 131 | * @return $instance |
132 | 132 | */ |
133 | - public function update( $new_instance, $old_instance ) { |
|
133 | + public function update($new_instance, $old_instance) { |
|
134 | 134 | |
135 | 135 | $instance = $old_instance; |
136 | 136 | |
137 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
137 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
138 | 138 | |
139 | 139 | return $instance; |
140 | 140 | } |
@@ -148,6 +148,6 @@ discard block |
||
148 | 148 | */ |
149 | 149 | function repro_trulia_rsslisting_widget() { |
150 | 150 | |
151 | - register_widget( 'TruliaRssListingWidget' ); |
|
151 | + register_widget('TruliaRssListingWidget'); |
|
152 | 152 | } |
153 | -add_action( 'widgets_init', 'repro_trulia_rsslisting_widget' ); |
|
153 | +add_action('widgets_init', 'repro_trulia_rsslisting_widget'); |