@@ -15,11 +15,11 @@ discard block |
||
15 | 15 | class geodir_popular_post_category extends WP_Widget |
16 | 16 | { |
17 | 17 | /** |
18 | - * Register the popular post category widget. |
|
19 | - * |
|
20 | - * @since 1.0.0 |
|
18 | + * Register the popular post category widget. |
|
19 | + * |
|
20 | + * @since 1.0.0 |
|
21 | 21 | * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
22 | - */ |
|
22 | + */ |
|
23 | 23 | function __construct() { |
24 | 24 | $widget_ops = array('classname' => 'geodir_popular_post_category', 'description' => __('GD > Popular Post Category', 'geodirectory')); |
25 | 25 | parent::__construct( |
@@ -29,53 +29,53 @@ discard block |
||
29 | 29 | ); |
30 | 30 | } |
31 | 31 | |
32 | - /** |
|
33 | - * Front-end display content for popular post category widget. |
|
34 | - * |
|
35 | - * @since 1.0.0 |
|
32 | + /** |
|
33 | + * Front-end display content for popular post category widget. |
|
34 | + * |
|
35 | + * @since 1.0.0 |
|
36 | 36 | * @since 1.5.1 Declare function public. |
37 | - * |
|
38 | - * @param array $args Widget arguments. |
|
39 | - * @param array $instance Saved values from database. |
|
40 | - */ |
|
41 | - public function widget($args, $instance) |
|
37 | + * |
|
38 | + * @param array $args Widget arguments. |
|
39 | + * @param array $instance Saved values from database. |
|
40 | + */ |
|
41 | + public function widget($args, $instance) |
|
42 | 42 | { |
43 | 43 | geodir_popular_post_category_output($args, $instance); |
44 | 44 | } |
45 | 45 | |
46 | - /** |
|
47 | - * Sanitize popular post category widget form values as they are saved. |
|
48 | - * |
|
49 | - * @since 1.0.0 |
|
46 | + /** |
|
47 | + * Sanitize popular post category widget form values as they are saved. |
|
48 | + * |
|
49 | + * @since 1.0.0 |
|
50 | 50 | * @since 1.5.1 Declare function public. |
51 | 51 | * @since 1.5.1 Added default_post_type parameter. |
52 | - * |
|
53 | - * @param array $new_instance Values just sent to be saved. |
|
54 | - * @param array $old_instance Previously saved values from database. |
|
55 | - * |
|
56 | - * @return array Updated safe values to be saved. |
|
57 | - */ |
|
58 | - public function update($new_instance, $old_instance) |
|
52 | + * |
|
53 | + * @param array $new_instance Values just sent to be saved. |
|
54 | + * @param array $old_instance Previously saved values from database. |
|
55 | + * |
|
56 | + * @return array Updated safe values to be saved. |
|
57 | + */ |
|
58 | + public function update($new_instance, $old_instance) |
|
59 | 59 | { |
60 | 60 | //save the widget |
61 | 61 | $instance = $old_instance; |
62 | 62 | $instance['title'] = strip_tags($new_instance['title']); |
63 | 63 | $category_limit = (int)$new_instance['category_limit']; |
64 | 64 | $instance['category_limit'] = $category_limit > 0 ? $category_limit : 15; |
65 | - $instance['default_post_type'] = isset($new_instance['default_post_type']) ? $new_instance['default_post_type'] : ''; |
|
65 | + $instance['default_post_type'] = isset($new_instance['default_post_type']) ? $new_instance['default_post_type'] : ''; |
|
66 | 66 | return $instance; |
67 | 67 | } |
68 | 68 | |
69 | - /** |
|
70 | - * Back-end popular post category widget settings form. |
|
71 | - * |
|
72 | - * @since 1.0.0 |
|
69 | + /** |
|
70 | + * Back-end popular post category widget settings form. |
|
71 | + * |
|
72 | + * @since 1.0.0 |
|
73 | 73 | * @since 1.5.1 Declare function public. |
74 | 74 | * @since 1.5.1 Added option to set default post type. |
75 | - * |
|
76 | - * @param array $instance Previously saved values from database. |
|
77 | - */ |
|
78 | - public function form($instance) |
|
75 | + * |
|
76 | + * @param array $instance Previously saved values from database. |
|
77 | + */ |
|
78 | + public function form($instance) |
|
79 | 79 | { |
80 | 80 | //widgetform in backend |
81 | 81 | $instance = wp_parse_args((array)$instance, array('title' => '', 'category_limit' => 15, 'default_post_type' => '')); |
@@ -83,9 +83,9 @@ discard block |
||
83 | 83 | $title = strip_tags($instance['title']); |
84 | 84 | $category_limit = (int)$instance['category_limit']; |
85 | 85 | $category_limit = $category_limit > 0 ? $category_limit : 15; |
86 | - $default_post_type = isset($instance['default_post_type']) ? $instance['default_post_type'] : ''; |
|
86 | + $default_post_type = isset($instance['default_post_type']) ? $instance['default_post_type'] : ''; |
|
87 | 87 | |
88 | - $post_type_options = geodir_get_posttypes('options'); |
|
88 | + $post_type_options = geodir_get_posttypes('options'); |
|
89 | 89 | ?> |
90 | 90 | <p> |
91 | 91 | <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory'); ?> |
@@ -131,11 +131,11 @@ discard block |
||
131 | 131 | { |
132 | 132 | |
133 | 133 | /** |
134 | - * Register the popular posts widget. |
|
135 | - * |
|
136 | - * @since 1.0.0 |
|
134 | + * Register the popular posts widget. |
|
135 | + * |
|
136 | + * @since 1.0.0 |
|
137 | 137 | * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
138 | - */ |
|
138 | + */ |
|
139 | 139 | function __construct() { |
140 | 140 | $widget_ops = array('classname' => 'geodir_popular_post_view', 'description' => __('GD > Popular Post View', 'geodirectory')); |
141 | 141 | parent::__construct( |
@@ -145,32 +145,32 @@ discard block |
||
145 | 145 | ); |
146 | 146 | } |
147 | 147 | |
148 | - /** |
|
149 | - * Front-end display content for popular posts widget. |
|
150 | - * |
|
151 | - * @since 1.0.0 |
|
148 | + /** |
|
149 | + * Front-end display content for popular posts widget. |
|
150 | + * |
|
151 | + * @since 1.0.0 |
|
152 | 152 | * @since 1.5.1 Declare function public. |
153 | - * |
|
154 | - * @param array $args Widget arguments. |
|
155 | - * @param array $instance Saved values from database. |
|
156 | - */ |
|
157 | - public function widget($args, $instance) |
|
153 | + * |
|
154 | + * @param array $args Widget arguments. |
|
155 | + * @param array $instance Saved values from database. |
|
156 | + */ |
|
157 | + public function widget($args, $instance) |
|
158 | 158 | { |
159 | 159 | geodir_popular_postview_output($args, $instance); |
160 | 160 | } |
161 | 161 | |
162 | - /** |
|
163 | - * Sanitize popular posts widget form values as they are saved. |
|
164 | - * |
|
165 | - * @since 1.0.0 |
|
162 | + /** |
|
163 | + * Sanitize popular posts widget form values as they are saved. |
|
164 | + * |
|
165 | + * @since 1.0.0 |
|
166 | 166 | * @since 1.5.1 Declare function public. |
167 | - * |
|
168 | - * @param array $new_instance Values just sent to be saved. |
|
169 | - * @param array $old_instance Previously saved values from database. |
|
170 | - * |
|
171 | - * @return array Updated safe values to be saved. |
|
172 | - */ |
|
173 | - public function update($new_instance, $old_instance) |
|
167 | + * |
|
168 | + * @param array $new_instance Values just sent to be saved. |
|
169 | + * @param array $old_instance Previously saved values from database. |
|
170 | + * |
|
171 | + * @return array Updated safe values to be saved. |
|
172 | + */ |
|
173 | + public function update($new_instance, $old_instance) |
|
174 | 174 | { |
175 | 175 | //save the widget |
176 | 176 | $instance = $old_instance; |
@@ -204,15 +204,15 @@ discard block |
||
204 | 204 | return $instance; |
205 | 205 | } |
206 | 206 | |
207 | - /** |
|
208 | - * Back-end popular posts widget settings form. |
|
209 | - * |
|
210 | - * @since 1.0.0 |
|
207 | + /** |
|
208 | + * Back-end popular posts widget settings form. |
|
209 | + * |
|
210 | + * @since 1.0.0 |
|
211 | 211 | * @since 1.5.1 Declare function public. |
212 | - * |
|
213 | - * @param array $instance Previously saved values from database. |
|
214 | - */ |
|
215 | - public function form($instance) |
|
212 | + * |
|
213 | + * @param array $instance Previously saved values from database. |
|
214 | + */ |
|
215 | + public function form($instance) |
|
216 | 216 | { |
217 | 217 | //widgetform in backend |
218 | 218 | $instance = wp_parse_args((array)$instance, |
@@ -282,14 +282,14 @@ discard block |
||
282 | 282 | for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory');?> |
283 | 283 | |
284 | 284 | <?php $postypes = geodir_get_posttypes(); |
285 | - /** |
|
286 | - * Filter the post types to display in widget. |
|
287 | - * |
|
288 | - * @since 1.0.0 |
|
289 | - * |
|
290 | - * @param array $postypes Post types array. |
|
291 | - */ |
|
292 | - $postypes = apply_filters('geodir_post_type_list_in_p_widget', $postypes); ?> |
|
285 | + /** |
|
286 | + * Filter the post types to display in widget. |
|
287 | + * |
|
288 | + * @since 1.0.0 |
|
289 | + * |
|
290 | + * @param array $postypes Post types array. |
|
291 | + */ |
|
292 | + $postypes = apply_filters('geodir_post_type_list_in_p_widget', $postypes); ?> |
|
293 | 293 | |
294 | 294 | <select class="widefat" id="<?php echo $this->get_field_id('post_type'); ?>" |
295 | 295 | name="<?php echo $this->get_field_name('post_type'); ?>" |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | //save the widget |
61 | 61 | $instance = $old_instance; |
62 | 62 | $instance['title'] = strip_tags($new_instance['title']); |
63 | - $category_limit = (int)$new_instance['category_limit']; |
|
63 | + $category_limit = (int) $new_instance['category_limit']; |
|
64 | 64 | $instance['category_limit'] = $category_limit > 0 ? $category_limit : 15; |
65 | 65 | $instance['default_post_type'] = isset($new_instance['default_post_type']) ? $new_instance['default_post_type'] : ''; |
66 | 66 | return $instance; |
@@ -78,10 +78,10 @@ discard block |
||
78 | 78 | public function form($instance) |
79 | 79 | { |
80 | 80 | //widgetform in backend |
81 | - $instance = wp_parse_args((array)$instance, array('title' => '', 'category_limit' => 15, 'default_post_type' => '')); |
|
81 | + $instance = wp_parse_args((array) $instance, array('title' => '', 'category_limit' => 15, 'default_post_type' => '')); |
|
82 | 82 | |
83 | 83 | $title = strip_tags($instance['title']); |
84 | - $category_limit = (int)$instance['category_limit']; |
|
84 | + $category_limit = (int) $instance['category_limit']; |
|
85 | 85 | $category_limit = $category_limit > 0 ? $category_limit : 15; |
86 | 86 | $default_post_type = isset($instance['default_post_type']) ? $instance['default_post_type'] : ''; |
87 | 87 | |
@@ -96,10 +96,10 @@ discard block |
||
96 | 96 | </p> |
97 | 97 | <p> |
98 | 98 | <label for="<?php echo $this->get_field_id('post_type'); ?>"> |
99 | - <?php _e('Default post type to use (if not set by page)', 'geodirectory');?> |
|
99 | + <?php _e('Default post type to use (if not set by page)', 'geodirectory'); ?> |
|
100 | 100 | <select class="widefat" id="<?php echo $this->get_field_id('default_post_type'); ?>" name="<?php echo $this->get_field_name('default_post_type'); ?>"> |
101 | 101 | <?php foreach ($post_type_options as $name => $title) { ?> |
102 | - <option value="<?php echo $name;?>" <?php selected($name, $default_post_type);?>><?php echo $title; ?></option> |
|
102 | + <option value="<?php echo $name; ?>" <?php selected($name, $default_post_type); ?>><?php echo $title; ?></option> |
|
103 | 103 | <?php } ?> |
104 | 104 | </select> |
105 | 105 | </label> |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | for="<?php echo $this->get_field_id('category_limit'); ?>"><?php _e('Customize categories count to appear by default:', 'geodirectory'); ?> |
110 | 110 | <input class="widefat" id="<?php echo $this->get_field_id('category_limit'); ?>" |
111 | 111 | name="<?php echo $this->get_field_name('category_limit'); ?>" type="text" |
112 | - value="<?php echo (int)esc_attr($category_limit); ?>"/> |
|
112 | + value="<?php echo (int) esc_attr($category_limit); ?>"/> |
|
113 | 113 | |
114 | 114 | <p class="description" |
115 | 115 | style="padding:0"><?php _e('After categories count reaches this limit option More Categories / Less Categoris will be displayed to show/hide categories. Default: 15', 'geodirectory'); ?></p> |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | public function form($instance) |
216 | 216 | { |
217 | 217 | //widgetform in backend |
218 | - $instance = wp_parse_args((array)$instance, |
|
218 | + $instance = wp_parse_args((array) $instance, |
|
219 | 219 | array('title' => '', |
220 | 220 | 'post_type' => '', |
221 | 221 | 'category' => array(), |
@@ -266,9 +266,9 @@ discard block |
||
266 | 266 | ?> |
267 | 267 | |
268 | 268 | <p> |
269 | - <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?> |
|
269 | + <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory'); ?> |
|
270 | 270 | <small>(%posttype_singular_label% , |
271 | - %posttype_plural_label% <?php _e('can be used', 'geodirectory');?>) |
|
271 | + %posttype_plural_label% <?php _e('can be used', 'geodirectory'); ?>) |
|
272 | 272 | </small> |
273 | 273 | |
274 | 274 | <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | |
280 | 280 | <p> |
281 | 281 | <label |
282 | - for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory');?> |
|
282 | + for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory'); ?> |
|
283 | 283 | |
284 | 284 | <?php $postypes = geodir_get_posttypes(); |
285 | 285 | /** |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | |
312 | 312 | <p id="post_type_cats"> |
313 | 313 | <label |
314 | - for="<?php echo $this->get_field_id('category'); ?>"><?php _e('Post Category:', 'geodirectory');?> |
|
314 | + for="<?php echo $this->get_field_id('category'); ?>"><?php _e('Post Category:', 'geodirectory'); ?> |
|
315 | 315 | |
316 | 316 | <?php |
317 | 317 | |
@@ -350,14 +350,14 @@ discard block |
||
350 | 350 | |
351 | 351 | <input type="hidden" name="<?php echo $this->get_field_name('category_title'); ?>" |
352 | 352 | id="<?php echo $this->get_field_id('category_title'); ?>" |
353 | - value="<?php if ($category_title != '') echo $category_title; else echo __('All', 'geodirectory');?>"/> |
|
353 | + value="<?php if ($category_title != '') echo $category_title; else echo __('All', 'geodirectory'); ?>"/> |
|
354 | 354 | |
355 | 355 | </label> |
356 | 356 | </p> |
357 | 357 | |
358 | 358 | <p> |
359 | 359 | <label |
360 | - for="<?php echo $this->get_field_id('list_sort'); ?>"><?php _e('Sort by:', 'geodirectory');?> |
|
360 | + for="<?php echo $this->get_field_id('list_sort'); ?>"><?php _e('Sort by:', 'geodirectory'); ?> |
|
361 | 361 | |
362 | 362 | <select class="widefat" id="<?php echo $this->get_field_id('list_sort'); ?>" |
363 | 363 | name="<?php echo $this->get_field_name('list_sort'); ?>"> |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | <p> |
394 | 394 | |
395 | 395 | <label |
396 | - for="<?php echo $this->get_field_id('post_number'); ?>"><?php _e('Number of posts:', 'geodirectory');?> |
|
396 | + for="<?php echo $this->get_field_id('post_number'); ?>"><?php _e('Number of posts:', 'geodirectory'); ?> |
|
397 | 397 | |
398 | 398 | <input class="widefat" id="<?php echo $this->get_field_id('post_number'); ?>" |
399 | 399 | name="<?php echo $this->get_field_name('post_number'); ?>" type="text" |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | |
404 | 404 | <p> |
405 | 405 | <label for="<?php echo $this->get_field_id('layout'); ?>"> |
406 | - <?php _e('Layout:', 'geodirectory');?> |
|
406 | + <?php _e('Layout:', 'geodirectory'); ?> |
|
407 | 407 | <select class="widefat" id="<?php echo $this->get_field_id('layout'); ?>" |
408 | 408 | name="<?php echo $this->get_field_name('layout'); ?>"> |
409 | 409 | <option <?php if ($layout == 'gridview_onehalf') { |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | |
433 | 433 | <p> |
434 | 434 | <label |
435 | - for="<?php echo $this->get_field_id('listing_width'); ?>"><?php _e('Listing width:', 'geodirectory');?> |
|
435 | + for="<?php echo $this->get_field_id('listing_width'); ?>"><?php _e('Listing width:', 'geodirectory'); ?> |
|
436 | 436 | |
437 | 437 | <input class="widefat" id="<?php echo $this->get_field_id('listing_width'); ?>" |
438 | 438 | name="<?php echo $this->get_field_name('listing_width'); ?>" type="text" |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | |
443 | 443 | <p> |
444 | 444 | <label |
445 | - for="<?php echo $this->get_field_id('character_count'); ?>"><?php _e('Post Content excerpt character count :', 'geodirectory');?> |
|
445 | + for="<?php echo $this->get_field_id('character_count'); ?>"><?php _e('Post Content excerpt character count :', 'geodirectory'); ?> |
|
446 | 446 | <input class="widefat" id="<?php echo $this->get_field_id('character_count'); ?>" |
447 | 447 | name="<?php echo $this->get_field_name('character_count'); ?>" type="text" |
448 | 448 | value="<?php echo esc_attr($character_count); ?>"/> |
@@ -451,41 +451,41 @@ discard block |
||
451 | 451 | |
452 | 452 | <p> |
453 | 453 | <label for="<?php echo $this->get_field_id('add_location_filter'); ?>"> |
454 | - <?php _e('Enable Location Filter:', 'geodirectory');?> |
|
454 | + <?php _e('Enable Location Filter:', 'geodirectory'); ?> |
|
455 | 455 | <input type="checkbox" id="<?php echo $this->get_field_id('add_location_filter'); ?>" |
456 | - name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"';?> |
|
456 | + name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"'; ?> |
|
457 | 457 | value="1"/> |
458 | 458 | </label> |
459 | 459 | </p> |
460 | 460 | <p> |
461 | 461 | <label for="<?php echo $this->get_field_id('show_featured_only'); ?>"> |
462 | - <?php _e('Show only featured listings:', 'geodirectory');?> <input type="checkbox" |
|
462 | + <?php _e('Show only featured listings:', 'geodirectory'); ?> <input type="checkbox" |
|
463 | 463 | id="<?php echo $this->get_field_id('show_featured_only'); ?>" |
464 | - name="<?php echo $this->get_field_name('show_featured_only'); ?>" <?php if ($show_featured_only) echo 'checked="checked"';?> |
|
464 | + name="<?php echo $this->get_field_name('show_featured_only'); ?>" <?php if ($show_featured_only) echo 'checked="checked"'; ?> |
|
465 | 465 | value="1"/> |
466 | 466 | </label> |
467 | 467 | </p> |
468 | 468 | <p> |
469 | 469 | <label for="<?php echo $this->get_field_id('show_special_only'); ?>"> |
470 | - <?php _e('Show only listings with special offers:', 'geodirectory');?> <input type="checkbox" |
|
470 | + <?php _e('Show only listings with special offers:', 'geodirectory'); ?> <input type="checkbox" |
|
471 | 471 | id="<?php echo $this->get_field_id('show_special_only'); ?>" |
472 | - name="<?php echo $this->get_field_name('show_special_only'); ?>" <?php if ($show_special_only) echo 'checked="checked"';?> |
|
472 | + name="<?php echo $this->get_field_name('show_special_only'); ?>" <?php if ($show_special_only) echo 'checked="checked"'; ?> |
|
473 | 473 | value="1"/> |
474 | 474 | </label> |
475 | 475 | </p> |
476 | 476 | <p> |
477 | 477 | <label for="<?php echo $this->get_field_id('with_pics_only'); ?>"> |
478 | - <?php _e('Show only listings with pics:', 'geodirectory');?> <input type="checkbox" |
|
478 | + <?php _e('Show only listings with pics:', 'geodirectory'); ?> <input type="checkbox" |
|
479 | 479 | id="<?php echo $this->get_field_id('with_pics_only'); ?>" |
480 | - name="<?php echo $this->get_field_name('with_pics_only'); ?>" <?php if ($with_pics_only) echo 'checked="checked"';?> |
|
480 | + name="<?php echo $this->get_field_name('with_pics_only'); ?>" <?php if ($with_pics_only) echo 'checked="checked"'; ?> |
|
481 | 481 | value="1"/> |
482 | 482 | </label> |
483 | 483 | </p> |
484 | 484 | <p> |
485 | 485 | <label for="<?php echo $this->get_field_id('with_videos_only'); ?>"> |
486 | - <?php _e('Show only listings with videos:', 'geodirectory');?> <input type="checkbox" |
|
486 | + <?php _e('Show only listings with videos:', 'geodirectory'); ?> <input type="checkbox" |
|
487 | 487 | id="<?php echo $this->get_field_id('with_videos_only'); ?>" |
488 | - name="<?php echo $this->get_field_name('with_videos_only'); ?>" <?php if ($with_videos_only) echo 'checked="checked"';?> |
|
488 | + name="<?php echo $this->get_field_name('with_videos_only'); ?>" <?php if ($with_videos_only) echo 'checked="checked"'; ?> |
|
489 | 489 | value="1"/> |
490 | 490 | </label> |
491 | 491 | </p> |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | |
532 | 532 | } |
533 | 533 | |
534 | - <?php if(is_active_widget( false, false, $this->id_base, true )){ ?> |
|
534 | + <?php if (is_active_widget(false, false, $this->id_base, true)) { ?> |
|
535 | 535 | var post_type = jQuery('#<?php echo $this->get_field_id('post_type'); ?>').val(); |
536 | 536 | |
537 | 537 | <?php } ?> |
@@ -190,10 +190,11 @@ discard block |
||
190 | 190 | $instance['listing_width'] = strip_tags($new_instance['listing_width']); |
191 | 191 | $instance['list_sort'] = strip_tags($new_instance['list_sort']); |
192 | 192 | $instance['character_count'] = $new_instance['character_count']; |
193 | - if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') |
|
194 | - $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']); |
|
195 | - else |
|
196 | - $instance['add_location_filter'] = '0'; |
|
193 | + if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') { |
|
194 | + $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']); |
|
195 | + } else { |
|
196 | + $instance['add_location_filter'] = '0'; |
|
197 | + } |
|
197 | 198 | |
198 | 199 | $instance['show_featured_only'] = isset($new_instance['show_featured_only']) && $new_instance['show_featured_only'] ? 1 : 0; |
199 | 200 | $instance['show_special_only'] = isset($new_instance['show_special_only']) && $new_instance['show_special_only'] ? 1 : 0; |
@@ -319,8 +320,9 @@ discard block |
||
319 | 320 | |
320 | 321 | $all_postypes = geodir_get_posttypes(); |
321 | 322 | |
322 | - if (!in_array($post_type, $all_postypes)) |
|
323 | - $post_type = 'gd_place'; |
|
323 | + if (!in_array($post_type, $all_postypes)) { |
|
324 | + $post_type = 'gd_place'; |
|
325 | + } |
|
324 | 326 | |
325 | 327 | $category_taxonomy = geodir_get_taxonomies($post_type); |
326 | 328 | $categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC')); |
@@ -335,8 +337,9 @@ discard block |
||
335 | 337 | } ?> value="0"><?php _e('All', 'geodirectory'); ?></option> |
336 | 338 | <?php foreach ($categories as $category_obj) { |
337 | 339 | $selected = ''; |
338 | - if (is_array($category) && in_array($category_obj->term_id, $category)) |
|
339 | - echo $selected = 'selected="selected"'; |
|
340 | + if (is_array($category) && in_array($category_obj->term_id, $category)) { |
|
341 | + echo $selected = 'selected="selected"'; |
|
342 | + } |
|
340 | 343 | |
341 | 344 | ?> |
342 | 345 | |
@@ -350,7 +353,12 @@ discard block |
||
350 | 353 | |
351 | 354 | <input type="hidden" name="<?php echo $this->get_field_name('category_title'); ?>" |
352 | 355 | id="<?php echo $this->get_field_id('category_title'); ?>" |
353 | - value="<?php if ($category_title != '') echo $category_title; else echo __('All', 'geodirectory');?>"/> |
|
356 | + value="<?php if ($category_title != '') { |
|
357 | + echo $category_title; |
|
358 | +} else { |
|
359 | + echo __('All', 'geodirectory'); |
|
360 | +} |
|
361 | +?>"/> |
|
354 | 362 | |
355 | 363 | </label> |
356 | 364 | </p> |
@@ -453,7 +461,10 @@ discard block |
||
453 | 461 | <label for="<?php echo $this->get_field_id('add_location_filter'); ?>"> |
454 | 462 | <?php _e('Enable Location Filter:', 'geodirectory');?> |
455 | 463 | <input type="checkbox" id="<?php echo $this->get_field_id('add_location_filter'); ?>" |
456 | - name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"';?> |
|
464 | + name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) { |
|
465 | + echo 'checked="checked"'; |
|
466 | +} |
|
467 | +?> |
|
457 | 468 | value="1"/> |
458 | 469 | </label> |
459 | 470 | </p> |
@@ -461,7 +472,10 @@ discard block |
||
461 | 472 | <label for="<?php echo $this->get_field_id('show_featured_only'); ?>"> |
462 | 473 | <?php _e('Show only featured listings:', 'geodirectory');?> <input type="checkbox" |
463 | 474 | id="<?php echo $this->get_field_id('show_featured_only'); ?>" |
464 | - name="<?php echo $this->get_field_name('show_featured_only'); ?>" <?php if ($show_featured_only) echo 'checked="checked"';?> |
|
475 | + name="<?php echo $this->get_field_name('show_featured_only'); ?>" <?php if ($show_featured_only) { |
|
476 | + echo 'checked="checked"'; |
|
477 | +} |
|
478 | +?> |
|
465 | 479 | value="1"/> |
466 | 480 | </label> |
467 | 481 | </p> |
@@ -469,7 +483,10 @@ discard block |
||
469 | 483 | <label for="<?php echo $this->get_field_id('show_special_only'); ?>"> |
470 | 484 | <?php _e('Show only listings with special offers:', 'geodirectory');?> <input type="checkbox" |
471 | 485 | id="<?php echo $this->get_field_id('show_special_only'); ?>" |
472 | - name="<?php echo $this->get_field_name('show_special_only'); ?>" <?php if ($show_special_only) echo 'checked="checked"';?> |
|
486 | + name="<?php echo $this->get_field_name('show_special_only'); ?>" <?php if ($show_special_only) { |
|
487 | + echo 'checked="checked"'; |
|
488 | +} |
|
489 | +?> |
|
473 | 490 | value="1"/> |
474 | 491 | </label> |
475 | 492 | </p> |
@@ -477,7 +494,10 @@ discard block |
||
477 | 494 | <label for="<?php echo $this->get_field_id('with_pics_only'); ?>"> |
478 | 495 | <?php _e('Show only listings with pics:', 'geodirectory');?> <input type="checkbox" |
479 | 496 | id="<?php echo $this->get_field_id('with_pics_only'); ?>" |
480 | - name="<?php echo $this->get_field_name('with_pics_only'); ?>" <?php if ($with_pics_only) echo 'checked="checked"';?> |
|
497 | + name="<?php echo $this->get_field_name('with_pics_only'); ?>" <?php if ($with_pics_only) { |
|
498 | + echo 'checked="checked"'; |
|
499 | +} |
|
500 | +?> |
|
481 | 501 | value="1"/> |
482 | 502 | </label> |
483 | 503 | </p> |
@@ -485,7 +505,10 @@ discard block |
||
485 | 505 | <label for="<?php echo $this->get_field_id('with_videos_only'); ?>"> |
486 | 506 | <?php _e('Show only listings with videos:', 'geodirectory');?> <input type="checkbox" |
487 | 507 | id="<?php echo $this->get_field_id('with_videos_only'); ?>" |
488 | - name="<?php echo $this->get_field_name('with_videos_only'); ?>" <?php if ($with_videos_only) echo 'checked="checked"';?> |
|
508 | + name="<?php echo $this->get_field_name('with_videos_only'); ?>" <?php if ($with_videos_only) { |
|
509 | + echo 'checked="checked"'; |
|
510 | +} |
|
511 | +?> |
|
489 | 512 | value="1"/> |
490 | 513 | </label> |
491 | 514 | </p> |
@@ -15,11 +15,11 @@ discard block |
||
15 | 15 | class geodir_related_listing_postview extends WP_Widget |
16 | 16 | { |
17 | 17 | /** |
18 | - * Register the related listing widget. |
|
19 | - * |
|
20 | - * @since 1.0.0 |
|
18 | + * Register the related listing widget. |
|
19 | + * |
|
20 | + * @since 1.0.0 |
|
21 | 21 | * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
22 | - */ |
|
22 | + */ |
|
23 | 23 | function __construct() { |
24 | 24 | $widget_ops = array('classname' => 'geodir_related_listing_post_view', 'description' => __('GD > Related Listing', 'geodirectory')); |
25 | 25 | parent::__construct( |
@@ -29,15 +29,15 @@ discard block |
||
29 | 29 | ); |
30 | 30 | } |
31 | 31 | |
32 | - /** |
|
33 | - * Front-end display content for related listing widget. |
|
34 | - * |
|
35 | - * @since 1.0.0 |
|
32 | + /** |
|
33 | + * Front-end display content for related listing widget. |
|
34 | + * |
|
35 | + * @since 1.0.0 |
|
36 | 36 | * @since 1.5.1 Declare function public. |
37 | - * |
|
38 | - * @param array $args Widget arguments. |
|
39 | - * @param array $instance Saved values from database. |
|
40 | - */ |
|
37 | + * |
|
38 | + * @param array $args Widget arguments. |
|
39 | + * @param array $instance Saved values from database. |
|
40 | + */ |
|
41 | 41 | public function widget($args, $instance) |
42 | 42 | { |
43 | 43 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $title = empty($instance['title']) ? __('Related Listing', 'geodirectory') : apply_filters('widget_title', __($instance['title'], 'geodirectory')); |
49 | 49 | |
50 | 50 | /** This filter is documented in geodirectory-functions/general_functions.php */ |
51 | - $post_number = empty($instance['post_number']) ? '5' : apply_filters('widget_post_number', $instance['post_number']); |
|
51 | + $post_number = empty($instance['post_number']) ? '5' : apply_filters('widget_post_number', $instance['post_number']); |
|
52 | 52 | |
53 | 53 | /** |
54 | 54 | * Filter the relation type to get related listing. |
@@ -56,22 +56,22 @@ discard block |
||
56 | 56 | * @since 1.0.0 |
57 | 57 | * @param string $instance['relate_to'] Can be tags or category. |
58 | 58 | */ |
59 | - $relate_to = empty($instance['relate_to']) ? 'category' : apply_filters('widget_relate_to', $instance['relate_to']); |
|
59 | + $relate_to = empty($instance['relate_to']) ? 'category' : apply_filters('widget_relate_to', $instance['relate_to']); |
|
60 | 60 | |
61 | 61 | /** This filter is documented in geodirectory-functions/general_functions.php */ |
62 | - $layout = empty($instance['layout']) ? 'gridview_onehalf' : apply_filters('widget_layout', $instance['layout']); |
|
62 | + $layout = empty($instance['layout']) ? 'gridview_onehalf' : apply_filters('widget_layout', $instance['layout']); |
|
63 | 63 | |
64 | 64 | /** This filter is documented in geodirectory-functions/general_functions.php */ |
65 | - $add_location_filter = empty($instance['add_location_filter']) ? '0' : apply_filters('widget_add_location_filter', $instance['add_location_filter']); |
|
65 | + $add_location_filter = empty($instance['add_location_filter']) ? '0' : apply_filters('widget_add_location_filter', $instance['add_location_filter']); |
|
66 | 66 | |
67 | 67 | /** This filter is documented in geodirectory-functions/general_functions.php */ |
68 | - $listing_width = empty($instance['listing_width']) ? '' : apply_filters('widget_listing_width', $instance['listing_width']); |
|
68 | + $listing_width = empty($instance['listing_width']) ? '' : apply_filters('widget_listing_width', $instance['listing_width']); |
|
69 | 69 | |
70 | 70 | /** This filter is documented in geodirectory-functions/general_functions.php */ |
71 | - $list_sort = empty($instance['list_sort']) ? 'latest' : apply_filters('widget_list_sort', $instance['list_sort']); |
|
71 | + $list_sort = empty($instance['list_sort']) ? 'latest' : apply_filters('widget_list_sort', $instance['list_sort']); |
|
72 | 72 | |
73 | 73 | /** This filter is documented in geodirectory-functions/general_functions.php */ |
74 | - $character_count = empty($instance['character_count']) ? 20 : apply_filters('widget_list_character_count', $instance['character_count']); |
|
74 | + $character_count = empty($instance['character_count']) ? 20 : apply_filters('widget_list_character_count', $instance['character_count']); |
|
75 | 75 | |
76 | 76 | $arr = array( |
77 | 77 | 'before_title' => $before_title, |
@@ -95,17 +95,17 @@ discard block |
||
95 | 95 | } |
96 | 96 | } |
97 | 97 | |
98 | - /** |
|
99 | - * Sanitize related listing widget form values as they are saved. |
|
100 | - * |
|
101 | - * @since 1.0.0 |
|
98 | + /** |
|
99 | + * Sanitize related listing widget form values as they are saved. |
|
100 | + * |
|
101 | + * @since 1.0.0 |
|
102 | 102 | * @since 1.5.1 Declare function public. |
103 | - * |
|
104 | - * @param array $new_instance Values just sent to be saved. |
|
105 | - * @param array $old_instance Previously saved values from database. |
|
106 | - * |
|
107 | - * @return array Updated safe values to be saved. |
|
108 | - */ |
|
103 | + * |
|
104 | + * @param array $new_instance Values just sent to be saved. |
|
105 | + * @param array $old_instance Previously saved values from database. |
|
106 | + * |
|
107 | + * @return array Updated safe values to be saved. |
|
108 | + */ |
|
109 | 109 | public function update($new_instance, $old_instance) |
110 | 110 | { |
111 | 111 | //save the widget |
@@ -126,14 +126,14 @@ discard block |
||
126 | 126 | return $instance; |
127 | 127 | } |
128 | 128 | |
129 | - /** |
|
130 | - * Back-end related listing widget settings form. |
|
131 | - * |
|
132 | - * @since 1.0.0 |
|
129 | + /** |
|
130 | + * Back-end related listing widget settings form. |
|
131 | + * |
|
132 | + * @since 1.0.0 |
|
133 | 133 | * @since 1.5.1 Declare function public. |
134 | - * |
|
135 | - * @param array $instance Previously saved values from database. |
|
136 | - */ |
|
134 | + * |
|
135 | + * @param array $instance Previously saved values from database. |
|
136 | + */ |
|
137 | 137 | public function form($instance) |
138 | 138 | { |
139 | 139 | //widgetform in backend |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | public function form($instance) |
138 | 138 | { |
139 | 139 | //widgetform in backend |
140 | - $instance = wp_parse_args((array)$instance, |
|
140 | + $instance = wp_parse_args((array) $instance, |
|
141 | 141 | array('title' => '', |
142 | 142 | 'list_sort' => '', |
143 | 143 | 'list_order' => '', |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | |
170 | 170 | ?> |
171 | 171 | <p> |
172 | - <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?> |
|
172 | + <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory'); ?> |
|
173 | 173 | |
174 | 174 | <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" |
175 | 175 | name="<?php echo $this->get_field_name('title'); ?>" type="text" |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | </p> |
179 | 179 | <p> |
180 | 180 | <label |
181 | - for="<?php echo $this->get_field_id('list_sort'); ?>"><?php _e('Sort by:', 'geodirectory');?> |
|
181 | + for="<?php echo $this->get_field_id('list_sort'); ?>"><?php _e('Sort by:', 'geodirectory'); ?> |
|
182 | 182 | |
183 | 183 | <select class="widefat" id="<?php echo $this->get_field_id('list_sort'); ?>" |
184 | 184 | name="<?php echo $this->get_field_name('list_sort'); ?>"> |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | </p> |
209 | 209 | <p> |
210 | 210 | <label |
211 | - for="<?php echo $this->get_field_id('post_number'); ?>"><?php _e('Number of posts:', 'geodirectory');?> |
|
211 | + for="<?php echo $this->get_field_id('post_number'); ?>"><?php _e('Number of posts:', 'geodirectory'); ?> |
|
212 | 212 | |
213 | 213 | <input class="widefat" id="<?php echo $this->get_field_id('post_number'); ?>" |
214 | 214 | name="<?php echo $this->get_field_name('post_number'); ?>" type="text" |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | </p> |
218 | 218 | <p> |
219 | 219 | <label for="<?php echo $this->get_field_id('relate_to'); ?>"> |
220 | - <?php _e('Relate to:', 'geodirectory');?> |
|
220 | + <?php _e('Relate to:', 'geodirectory'); ?> |
|
221 | 221 | <select class="widefat" id="<?php echo $this->get_field_id('relate_to'); ?>" |
222 | 222 | name="<?php echo $this->get_field_name('relate_to'); ?>"> |
223 | 223 | <option <?php if ($relate_to == 'category') { |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | <p> |
233 | 233 | <p> |
234 | 234 | <label for="<?php echo $this->get_field_id('layout'); ?>"> |
235 | - <?php _e('Layout:', 'geodirectory');?> |
|
235 | + <?php _e('Layout:', 'geodirectory'); ?> |
|
236 | 236 | <select class="widefat" id="<?php echo $this->get_field_id('layout'); ?>" |
237 | 237 | name="<?php echo $this->get_field_name('layout'); ?>"> |
238 | 238 | <option <?php if ($layout == 'gridview_onehalf') { |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | </p> |
261 | 261 | <p> |
262 | 262 | <label |
263 | - for="<?php echo $this->get_field_id('listing_width'); ?>"><?php _e('Listing width:', 'geodirectory');?> |
|
263 | + for="<?php echo $this->get_field_id('listing_width'); ?>"><?php _e('Listing width:', 'geodirectory'); ?> |
|
264 | 264 | |
265 | 265 | <input class="widefat" id="<?php echo $this->get_field_id('listing_width'); ?>" |
266 | 266 | name="<?php echo $this->get_field_name('listing_width'); ?>" type="text" |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | </p> |
270 | 270 | <p> |
271 | 271 | <label |
272 | - for="<?php echo $this->get_field_id('character_count'); ?>"><?php _e('Post Content excerpt character count :', 'geodirectory');?> |
|
272 | + for="<?php echo $this->get_field_id('character_count'); ?>"><?php _e('Post Content excerpt character count :', 'geodirectory'); ?> |
|
273 | 273 | <input class="widefat" id="<?php echo $this->get_field_id('character_count'); ?>" |
274 | 274 | name="<?php echo $this->get_field_name('character_count'); ?>" type="text" |
275 | 275 | value="<?php echo esc_attr($character_count); ?>"/> |
@@ -277,9 +277,9 @@ discard block |
||
277 | 277 | </p> |
278 | 278 | <p> |
279 | 279 | <label for="<?php echo $this->get_field_id('add_location_filter'); ?>"> |
280 | - <?php _e('Enable Location Filter:', 'geodirectory');?> |
|
280 | + <?php _e('Enable Location Filter:', 'geodirectory'); ?> |
|
281 | 281 | <input type="checkbox" id="<?php echo $this->get_field_id('add_location_filter'); ?>" |
282 | - name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"';?> |
|
282 | + name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"'; ?> |
|
283 | 283 | value="1"/> |
284 | 284 | </label> |
285 | 285 | </p> |
@@ -118,10 +118,11 @@ discard block |
||
118 | 118 | $instance['listing_width'] = strip_tags($new_instance['listing_width']); |
119 | 119 | $instance['list_sort'] = strip_tags($new_instance['list_sort']); |
120 | 120 | $instance['character_count'] = $new_instance['character_count']; |
121 | - if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') |
|
122 | - $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']); |
|
123 | - else |
|
124 | - $instance['add_location_filter'] = '0'; |
|
121 | + if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') { |
|
122 | + $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']); |
|
123 | + } else { |
|
124 | + $instance['add_location_filter'] = '0'; |
|
125 | + } |
|
125 | 126 | |
126 | 127 | return $instance; |
127 | 128 | } |
@@ -279,7 +280,10 @@ discard block |
||
279 | 280 | <label for="<?php echo $this->get_field_id('add_location_filter'); ?>"> |
280 | 281 | <?php _e('Enable Location Filter:', 'geodirectory');?> |
281 | 282 | <input type="checkbox" id="<?php echo $this->get_field_id('add_location_filter'); ?>" |
282 | - name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"';?> |
|
283 | + name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) { |
|
284 | + echo 'checked="checked"'; |
|
285 | +} |
|
286 | +?> |
|
283 | 287 | value="1"/> |
284 | 288 | </label> |
285 | 289 | </p> |
@@ -15,11 +15,11 @@ discard block |
||
15 | 15 | class geodir_recent_reviews_widget extends WP_Widget |
16 | 16 | { |
17 | 17 | /** |
18 | - * Register the recent reviews widget. |
|
19 | - * |
|
20 | - * @since 1.0.0 |
|
18 | + * Register the recent reviews widget. |
|
19 | + * |
|
20 | + * @since 1.0.0 |
|
21 | 21 | * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
22 | - */ |
|
22 | + */ |
|
23 | 23 | function __construct() { |
24 | 24 | $widget_ops = array('classname' => 'geodir_recent_reviews', 'description' => __('GD > Recent Reviews', 'geodirectory')); |
25 | 25 | parent::__construct( |
@@ -29,16 +29,16 @@ discard block |
||
29 | 29 | ); |
30 | 30 | } |
31 | 31 | |
32 | - /** |
|
33 | - * Front-end display content for recent reviews widget. |
|
34 | - * |
|
35 | - * @since 1.0.0 |
|
32 | + /** |
|
33 | + * Front-end display content for recent reviews widget. |
|
34 | + * |
|
35 | + * @since 1.0.0 |
|
36 | 36 | * @since 1.5.1 Declare function public. |
37 | - * |
|
38 | - * @param array $args Widget arguments. |
|
39 | - * @param array $instance Saved values from database. |
|
40 | - */ |
|
41 | - public function widget($args, $instance) |
|
37 | + * |
|
38 | + * @param array $args Widget arguments. |
|
39 | + * @param array $instance Saved values from database. |
|
40 | + */ |
|
41 | + public function widget($args, $instance) |
|
42 | 42 | { |
43 | 43 | // prints the widget |
44 | 44 | extract($args, EXTR_SKIP); |
@@ -46,23 +46,23 @@ discard block |
||
46 | 46 | /** This filter is documented in geodirectory_widgets.php */ |
47 | 47 | $title = empty($instance['title']) ? '' : apply_filters('widget_title', __($instance['title'], 'geodirectory')); |
48 | 48 | |
49 | - /** |
|
50 | - * Filter the number of reviews to display. |
|
51 | - * |
|
52 | - * @since 1.0.0 |
|
53 | - * |
|
54 | - * @param int $instance['count'] Number of reviews to display. |
|
55 | - */ |
|
56 | - $count = empty($instance['count']) ? '5' : apply_filters('widget_count', $instance['count']); |
|
49 | + /** |
|
50 | + * Filter the number of reviews to display. |
|
51 | + * |
|
52 | + * @since 1.0.0 |
|
53 | + * |
|
54 | + * @param int $instance['count'] Number of reviews to display. |
|
55 | + */ |
|
56 | + $count = empty($instance['count']) ? '5' : apply_filters('widget_count', $instance['count']); |
|
57 | 57 | |
58 | - /** |
|
59 | - * Filter the height and width of the avatar image in pixels. |
|
60 | - * |
|
61 | - * @since 1.0.0 |
|
62 | - * |
|
63 | - * @param int $g_size Height and width of the avatar image in pixels. Default 30. |
|
64 | - */ |
|
65 | - $g_size = apply_filters('geodir_recent_reviews_g_size', 30); |
|
58 | + /** |
|
59 | + * Filter the height and width of the avatar image in pixels. |
|
60 | + * |
|
61 | + * @since 1.0.0 |
|
62 | + * |
|
63 | + * @param int $g_size Height and width of the avatar image in pixels. Default 30. |
|
64 | + */ |
|
65 | + $g_size = apply_filters('geodir_recent_reviews_g_size', 30); |
|
66 | 66 | /** |
67 | 67 | * Filter the excerpt length |
68 | 68 | * |
@@ -87,18 +87,18 @@ discard block |
||
87 | 87 | } |
88 | 88 | } |
89 | 89 | |
90 | - /** |
|
91 | - * Sanitize recent reviews widget form values as they are saved. |
|
92 | - * |
|
93 | - * @since 1.0.0 |
|
90 | + /** |
|
91 | + * Sanitize recent reviews widget form values as they are saved. |
|
92 | + * |
|
93 | + * @since 1.0.0 |
|
94 | 94 | * @since 1.5.1 Declare function public. |
95 | - * |
|
96 | - * @param array $new_instance Values just sent to be saved. |
|
97 | - * @param array $old_instance Previously saved values from database. |
|
98 | - * |
|
99 | - * @return array Updated safe values to be saved. |
|
100 | - */ |
|
101 | - public function update($new_instance, $old_instance) |
|
95 | + * |
|
96 | + * @param array $new_instance Values just sent to be saved. |
|
97 | + * @param array $old_instance Previously saved values from database. |
|
98 | + * |
|
99 | + * @return array Updated safe values to be saved. |
|
100 | + */ |
|
101 | + public function update($new_instance, $old_instance) |
|
102 | 102 | { |
103 | 103 | //save the widget |
104 | 104 | $instance = $old_instance; |
@@ -107,15 +107,15 @@ discard block |
||
107 | 107 | return $instance; |
108 | 108 | } |
109 | 109 | |
110 | - /** |
|
111 | - * Back-end recent reviews widget settings form. |
|
112 | - * |
|
113 | - * @since 1.0.0 |
|
110 | + /** |
|
111 | + * Back-end recent reviews widget settings form. |
|
112 | + * |
|
113 | + * @since 1.0.0 |
|
114 | 114 | * @since 1.5.1 Declare function public. |
115 | - * |
|
116 | - * @param array $instance Previously saved values from database. |
|
117 | - */ |
|
118 | - public function form($instance) |
|
115 | + * |
|
116 | + * @param array $instance Previously saved values from database. |
|
117 | + */ |
|
118 | + public function form($instance) |
|
119 | 119 | { |
120 | 120 | //widgetform in backend |
121 | 121 | $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'count' => '')); |
@@ -118,7 +118,7 @@ |
||
118 | 118 | public function form($instance) |
119 | 119 | { |
120 | 120 | //widgetform in backend |
121 | - $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'count' => '')); |
|
121 | + $instance = wp_parse_args((array) $instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'count' => '')); |
|
122 | 122 | $title = strip_tags($instance['title']); |
123 | 123 | $count = strip_tags($instance['count']); |
124 | 124 | ?> |
@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | class geodir_homepage_map extends WP_Widget |
18 | 18 | { |
19 | 19 | /** |
20 | - * Register the home page map widget. |
|
21 | - * |
|
22 | - * @since 1.0.0 |
|
20 | + * Register the home page map widget. |
|
21 | + * |
|
22 | + * @since 1.0.0 |
|
23 | 23 | * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
24 | - */ |
|
24 | + */ |
|
25 | 25 | function __construct() { |
26 | 26 | $widget_ops = array('classname' => 'widget Google Map in Home page', 'description' => __('Google Map in Home page. It will show you google map V3 for Home page with category checkbox selection.', 'geodirectory')); |
27 | 27 | parent::__construct( |
@@ -31,15 +31,15 @@ discard block |
||
31 | 31 | ); |
32 | 32 | } |
33 | 33 | |
34 | - /** |
|
35 | - * Front-end display content for home page map widget. |
|
36 | - * |
|
37 | - * @since 1.0.0 |
|
34 | + /** |
|
35 | + * Front-end display content for home page map widget. |
|
36 | + * |
|
37 | + * @since 1.0.0 |
|
38 | 38 | * @since 1.5.1 Declare function public. |
39 | - * |
|
40 | - * @param array $args Widget arguments. |
|
41 | - * @param array $instance Saved values from database. |
|
42 | - */ |
|
39 | + * |
|
40 | + * @param array $args Widget arguments. |
|
41 | + * @param array $instance Saved values from database. |
|
42 | + */ |
|
43 | 43 | public function widget($args, $instance) |
44 | 44 | { |
45 | 45 | extract($args, EXTR_SKIP); |
@@ -90,17 +90,17 @@ discard block |
||
90 | 90 | |
91 | 91 | } |
92 | 92 | |
93 | - /** |
|
94 | - * Sanitize home page map widget form values as they are saved. |
|
95 | - * |
|
96 | - * @since 1.0.0 |
|
93 | + /** |
|
94 | + * Sanitize home page map widget form values as they are saved. |
|
95 | + * |
|
96 | + * @since 1.0.0 |
|
97 | 97 | * @since 1.5.1 Declare function public. |
98 | - * |
|
99 | - * @param array $new_instance Values just sent to be saved. |
|
100 | - * @param array $old_instance Previously saved values from database. |
|
101 | - * |
|
102 | - * @return array Updated safe values to be saved. |
|
103 | - */ |
|
98 | + * |
|
99 | + * @param array $new_instance Values just sent to be saved. |
|
100 | + * @param array $old_instance Previously saved values from database. |
|
101 | + * |
|
102 | + * @return array Updated safe values to be saved. |
|
103 | + */ |
|
104 | 104 | public function update($new_instance, $old_instance) |
105 | 105 | { |
106 | 106 | //save the widget |
@@ -116,14 +116,14 @@ discard block |
||
116 | 116 | return $instance; |
117 | 117 | } |
118 | 118 | |
119 | - /** |
|
120 | - * Back-end home page map widget settings form. |
|
121 | - * |
|
122 | - * @since 1.0.0 |
|
119 | + /** |
|
120 | + * Back-end home page map widget settings form. |
|
121 | + * |
|
122 | + * @since 1.0.0 |
|
123 | 123 | * @since 1.5.1 Declare function public. |
124 | - * |
|
125 | - * @param array $instance Previously saved values from database. |
|
126 | - */ |
|
124 | + * |
|
125 | + * @param array $instance Previously saved values from database. |
|
126 | + */ |
|
127 | 127 | public function form($instance) |
128 | 128 | { |
129 | 129 | //widgetform in backend |
@@ -238,11 +238,11 @@ discard block |
||
238 | 238 | } |
239 | 239 | |
240 | 240 | /** |
241 | - * Adds the javascript in the footer for home page map widget. |
|
242 | - * |
|
243 | - * @since 1.0.0 |
|
241 | + * Adds the javascript in the footer for home page map widget. |
|
242 | + * |
|
243 | + * @since 1.0.0 |
|
244 | 244 | * @since 1.5.1 Declare function public. |
245 | - */ |
|
245 | + */ |
|
246 | 246 | public function geodir_home_map_add_script() |
247 | 247 | { |
248 | 248 | ?> |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | { |
129 | 129 | //widgetform in backend |
130 | 130 | |
131 | - $instance = wp_parse_args((array)$instance, array('width' => '', 'heigh' => '', 'maptype' => '', 'zoom' => '', 'autozoom' => '', 'child_collapse' => '0', 'scrollwheel' => '0')); |
|
131 | + $instance = wp_parse_args((array) $instance, array('width' => '', 'heigh' => '', 'maptype' => '', 'zoom' => '', 'autozoom' => '', 'child_collapse' => '0', 'scrollwheel' => '0')); |
|
132 | 132 | $width = strip_tags($instance['width']); |
133 | 133 | $heigh = strip_tags($instance['heigh']); |
134 | 134 | $maptype = strip_tags($instance['maptype']); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | <option <?php if (isset($maptype) && $maptype == 'HYBRID') { |
174 | 174 | echo 'selected="selected"'; |
175 | 175 | } ?> value="HYBRID"><?php _e('Hybrid Map', 'geodirectory'); ?></option> |
176 | - <option <?php selected($maptype, 'TERRAIN');?> |
|
176 | + <option <?php selected($maptype, 'TERRAIN'); ?> |
|
177 | 177 | value="TERRAIN"><?php _e('Terrain Map', 'geodirectory'); ?></option> |
178 | 178 | </select> |
179 | 179 | </label> |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | : |
221 | 221 | <input id="<?php echo $this->get_field_id('child_collapse'); ?>" |
222 | 222 | name="<?php echo $this->get_field_name('child_collapse'); ?>" type="checkbox" value="1" |
223 | - <?php if ($child_collapse){ ?>checked="checked" <?php } ?> /> |
|
223 | + <?php if ($child_collapse) { ?>checked="checked" <?php } ?> /> |
|
224 | 224 | </label> |
225 | 225 | </p> |
226 | 226 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | : |
231 | 231 | <input id="<?php echo $this->get_field_id('scrollwheel'); ?>" |
232 | 232 | name="<?php echo $this->get_field_name('scrollwheel'); ?>" type="checkbox" value="1" |
233 | - <?php if ($scrollwheel){ ?>checked="checked" <?php } ?> /> |
|
233 | + <?php if ($scrollwheel) { ?>checked="checked" <?php } ?> /> |
|
234 | 234 | </label> |
235 | 235 | </p> |
236 | 236 |
@@ -192,8 +192,9 @@ |
||
192 | 192 | |
193 | 193 | foreach ($map_zoom_level as $level) { |
194 | 194 | $selected = ''; |
195 | - if ($level == $zoom) |
|
196 | - $selected = 'selected="selected"'; |
|
195 | + if ($level == $zoom) { |
|
196 | + $selected = 'selected="selected"'; |
|
197 | + } |
|
197 | 198 | |
198 | 199 | echo '<option ' . $selected . ' value="' . $level . '">' . $level . '</option>'; |
199 | 200 |
@@ -90,11 +90,11 @@ discard block |
||
90 | 90 | { |
91 | 91 | |
92 | 92 | /** |
93 | - * Register the listing page map widget. |
|
94 | - * |
|
95 | - * @since 1.0.0 |
|
93 | + * Register the listing page map widget. |
|
94 | + * |
|
95 | + * @since 1.0.0 |
|
96 | 96 | * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
97 | - */ |
|
97 | + */ |
|
98 | 98 | function __construct() { |
99 | 99 | $widget_ops = array('classname' => 'widget geodir-map-listing-page', 'description' => __('Google Map for Listing page. It will show you google map V3 for Listing page.', 'geodirectory')); |
100 | 100 | parent::__construct( |
@@ -110,17 +110,17 @@ discard block |
||
110 | 110 | add_action('wp_footer', 'show_listing_widget_map'); // Show map for listings with markers |
111 | 111 | } |
112 | 112 | |
113 | - /** |
|
114 | - * Front-end display content for listing page map widget. |
|
115 | - * |
|
116 | - * @since 1.0.0 |
|
113 | + /** |
|
114 | + * Front-end display content for listing page map widget. |
|
115 | + * |
|
116 | + * @since 1.0.0 |
|
117 | 117 | * @since 1.5.1 Declare function public. |
118 | - * |
|
118 | + * |
|
119 | 119 | * @global object $post The current post object. |
120 | 120 | * |
121 | - * @param array $args Widget arguments. |
|
122 | - * @param array $instance Saved values from database. |
|
123 | - */ |
|
121 | + * @param array $args Widget arguments. |
|
122 | + * @param array $instance Saved values from database. |
|
123 | + */ |
|
124 | 124 | public function widget($args, $instance) |
125 | 125 | { |
126 | 126 | |
@@ -150,17 +150,17 @@ discard block |
||
150 | 150 | $scrollwheel = empty($instance['scrollwheel']) ? '0' : apply_filters('widget_scrollwheel', $instance['scrollwheel']); |
151 | 151 | $showall = empty($instance['showall']) ? '0' : apply_filters('widget_showall', $instance['showall']); |
152 | 152 | |
153 | - /** |
|
153 | + /** |
|
154 | 154 | * Filter the listing map should to be displayed or not. |
155 | 155 | * |
156 | 156 | * @since 1.4.6 |
157 | - * |
|
157 | + * |
|
158 | 158 | * @param bool $display true if map should be displayed, false if not. |
159 | 159 | */ |
160 | - $show_map = apply_filters( 'geodir_show_map_listing', $display = true ); |
|
161 | - if ( !$show_map ) { |
|
162 | - return; |
|
163 | - } |
|
160 | + $show_map = apply_filters( 'geodir_show_map_listing', $display = true ); |
|
161 | + if ( !$show_map ) { |
|
162 | + return; |
|
163 | + } |
|
164 | 164 | |
165 | 165 | $map_args = array(); |
166 | 166 | $map_args['map_canvas_name'] = str_replace('-', '_', $args['widget_id']); |
@@ -219,17 +219,17 @@ discard block |
||
219 | 219 | endif; |
220 | 220 | } |
221 | 221 | |
222 | - /** |
|
223 | - * Sanitize listing page map widget form values as they are saved. |
|
224 | - * |
|
225 | - * @since 1.0.0 |
|
222 | + /** |
|
223 | + * Sanitize listing page map widget form values as they are saved. |
|
224 | + * |
|
225 | + * @since 1.0.0 |
|
226 | 226 | * @since 1.5.1 Declare function public. |
227 | - * |
|
228 | - * @param array $new_instance Values just sent to be saved. |
|
229 | - * @param array $old_instance Previously saved values from database. |
|
230 | - * |
|
231 | - * @return array Updated safe values to be saved. |
|
232 | - */ |
|
227 | + * |
|
228 | + * @param array $new_instance Values just sent to be saved. |
|
229 | + * @param array $old_instance Previously saved values from database. |
|
230 | + * |
|
231 | + * @return array Updated safe values to be saved. |
|
232 | + */ |
|
233 | 233 | public function update($new_instance, $old_instance) |
234 | 234 | { |
235 | 235 | //save the widget |
@@ -246,14 +246,14 @@ discard block |
||
246 | 246 | return $instance; |
247 | 247 | } |
248 | 248 | |
249 | - /** |
|
250 | - * Back-end listing page map widget settings form. |
|
251 | - * |
|
252 | - * @since 1.0.0 |
|
249 | + /** |
|
250 | + * Back-end listing page map widget settings form. |
|
251 | + * |
|
252 | + * @since 1.0.0 |
|
253 | 253 | * @since 1.5.1 Declare function public. |
254 | - * |
|
255 | - * @param array $instance Previously saved values from database. |
|
256 | - */ |
|
254 | + * |
|
255 | + * @param array $instance Previously saved values from database. |
|
256 | + */ |
|
257 | 257 | public function form($instance) |
258 | 258 | { |
259 | 259 | //widgetform in backend |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @param string $post->marker_json JSON representation of the post marker info. |
46 | 46 | * @param object $post The post object. |
47 | 47 | */ |
48 | - $list_map_json[] = apply_filters('geodir_create_list_jsondata',$post->marker_json,$post); |
|
48 | + $list_map_json[] = apply_filters('geodir_create_list_jsondata', $post->marker_json, $post); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | } |
@@ -157,8 +157,8 @@ discard block |
||
157 | 157 | * |
158 | 158 | * @param bool $display true if map should be displayed, false if not. |
159 | 159 | */ |
160 | - $show_map = apply_filters( 'geodir_show_map_listing', $display = true ); |
|
161 | - if ( !$show_map ) { |
|
160 | + $show_map = apply_filters('geodir_show_map_listing', $display = true); |
|
161 | + if (!$show_map) { |
|
162 | 162 | return; |
163 | 163 | } |
164 | 164 | |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | public function form($instance) |
258 | 258 | { |
259 | 259 | //widgetform in backend |
260 | - $instance = wp_parse_args((array)$instance, array('width' => '', 'heigh' => '', 'maptype' => '', 'zoom' => '', 'autozoom' => '', 'sticky' => '', 'scrollwheel' => '0', 'showall' => '0')); |
|
260 | + $instance = wp_parse_args((array) $instance, array('width' => '', 'heigh' => '', 'maptype' => '', 'zoom' => '', 'autozoom' => '', 'sticky' => '', 'scrollwheel' => '0', 'showall' => '0')); |
|
261 | 261 | $width = strip_tags($instance['width']); |
262 | 262 | $heigh = strip_tags($instance['heigh']); |
263 | 263 | $maptype = strip_tags($instance['maptype']); |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | <option <?php if (isset($maptype) && $maptype == 'HYBRID') { |
304 | 304 | echo 'selected="selected"'; |
305 | 305 | } ?> value="HYBRID"><?php _e('Hybrid Map', 'geodirectory'); ?></option> |
306 | - <option <?php selected($maptype, 'TERRAIN');?> |
|
306 | + <option <?php selected($maptype, 'TERRAIN'); ?> |
|
307 | 307 | value="TERRAIN"><?php _e('Terrain Map', 'geodirectory'); ?></option> |
308 | 308 | </select> |
309 | 309 | </label> |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | : |
362 | 362 | <input id="<?php echo $this->get_field_id('scrollwheel'); ?>" |
363 | 363 | name="<?php echo $this->get_field_name('scrollwheel'); ?>" type="checkbox" value="1" |
364 | - <?php if ($scrollwheel){ ?>checked="checked" <?php } ?> /> |
|
364 | + <?php if ($scrollwheel) { ?>checked="checked" <?php } ?> /> |
|
365 | 365 | </label> |
366 | 366 | </p> |
367 | 367 |
@@ -69,10 +69,11 @@ discard block |
||
69 | 69 | $totalcount = count(array_unique($list_map_json)); |
70 | 70 | |
71 | 71 | |
72 | - if (!empty($cat_content_info)) |
|
73 | - $list_json = '[{"totalcount":"' . $totalcount . '",' . substr(implode(',', $cat_content_info), 1) . ']'; |
|
74 | - else |
|
75 | - $list_json = '[{"totalcount":"0"}]'; |
|
72 | + if (!empty($cat_content_info)) { |
|
73 | + $list_json = '[{"totalcount":"' . $totalcount . '",' . substr(implode(',', $cat_content_info), 1) . ']'; |
|
74 | + } else { |
|
75 | + $list_json = '[{"totalcount":"0"}]'; |
|
76 | + } |
|
76 | 77 | |
77 | 78 | $listing_map_args = array('list_json' => $list_json); |
78 | 79 | |
@@ -195,7 +196,9 @@ discard block |
||
195 | 196 | $mapview = $maptype; |
196 | 197 | } |
197 | 198 | |
198 | - if (empty($mapzoom)) $mapzoom = $zoom; |
|
199 | + if (empty($mapzoom)) { |
|
200 | + $mapzoom = $zoom; |
|
201 | + } |
|
199 | 202 | |
200 | 203 | // Set default map options |
201 | 204 | $map_args['ajax_url'] = geodir_get_ajax_url(); |
@@ -323,8 +326,9 @@ discard block |
||
323 | 326 | |
324 | 327 | foreach ($map_zoom_level as $level) { |
325 | 328 | $selected = ''; |
326 | - if ($level == $zoom) |
|
327 | - $selected = 'selected="selected"'; |
|
329 | + if ($level == $zoom) { |
|
330 | + $selected = 'selected="selected"'; |
|
331 | + } |
|
328 | 332 | |
329 | 333 | echo '<option ' . $selected . ' value="' . $level . '">' . $level . '</option>'; |
330 | 334 |
@@ -197,7 +197,7 @@ |
||
197 | 197 | * @since 1.5.6 |
198 | 198 | */ |
199 | 199 | global $pagenow; |
200 | - // if ( 'plugins.php' === $pagenow ) |
|
200 | + // if ( 'plugins.php' === $pagenow ) |
|
201 | 201 | { |
202 | 202 | // Better update message |
203 | 203 | $file = basename( __FILE__ ); |
@@ -74,7 +74,9 @@ discard block |
||
74 | 74 | /** |
75 | 75 | * Do not store any revisions (except the one autosave per post). |
76 | 76 | */ |
77 | -if (!defined('WP_POST_REVISIONS')) define('WP_POST_REVISIONS', 0); |
|
77 | +if (!defined('WP_POST_REVISIONS')) { |
|
78 | + define('WP_POST_REVISIONS', 0); |
|
79 | +} |
|
78 | 80 | |
79 | 81 | |
80 | 82 | /* |
@@ -82,17 +84,29 @@ discard block |
||
82 | 84 | */ |
83 | 85 | |
84 | 86 | /** Define the database name for the countries table. */ |
85 | -if (!defined('GEODIR_COUNTRIES_TABLE')) define('GEODIR_COUNTRIES_TABLE', $plugin_prefix . 'countries'); |
|
87 | +if (!defined('GEODIR_COUNTRIES_TABLE')) { |
|
88 | + define('GEODIR_COUNTRIES_TABLE', $plugin_prefix . 'countries'); |
|
89 | +} |
|
86 | 90 | /** Define the database name for the custom fields table. */ |
87 | -if (!defined('GEODIR_CUSTOM_FIELDS_TABLE')) define('GEODIR_CUSTOM_FIELDS_TABLE', $plugin_prefix . 'custom_fields'); |
|
91 | +if (!defined('GEODIR_CUSTOM_FIELDS_TABLE')) { |
|
92 | + define('GEODIR_CUSTOM_FIELDS_TABLE', $plugin_prefix . 'custom_fields'); |
|
93 | +} |
|
88 | 94 | /** Define the database name for the icons table. */ |
89 | -if (!defined('GEODIR_ICON_TABLE')) define('GEODIR_ICON_TABLE', $plugin_prefix . 'post_icon'); |
|
95 | +if (!defined('GEODIR_ICON_TABLE')) { |
|
96 | + define('GEODIR_ICON_TABLE', $plugin_prefix . 'post_icon'); |
|
97 | +} |
|
90 | 98 | /** Define the database name for the attachments table. */ |
91 | -if (!defined('GEODIR_ATTACHMENT_TABLE')) define('GEODIR_ATTACHMENT_TABLE', $plugin_prefix . 'attachments'); |
|
99 | +if (!defined('GEODIR_ATTACHMENT_TABLE')) { |
|
100 | + define('GEODIR_ATTACHMENT_TABLE', $plugin_prefix . 'attachments'); |
|
101 | +} |
|
92 | 102 | /** Define the database name for the review table. */ |
93 | -if (!defined('GEODIR_REVIEW_TABLE')) define('GEODIR_REVIEW_TABLE', $plugin_prefix . 'post_review'); |
|
103 | +if (!defined('GEODIR_REVIEW_TABLE')) { |
|
104 | + define('GEODIR_REVIEW_TABLE', $plugin_prefix . 'post_review'); |
|
105 | +} |
|
94 | 106 | /** Define the database name for the custom sort fields table. */ |
95 | -if (!defined('GEODIR_CUSTOM_SORT_FIELDS_TABLE')) define('GEODIR_CUSTOM_SORT_FIELDS_TABLE', $plugin_prefix . 'custom_sort_fields'); |
|
107 | +if (!defined('GEODIR_CUSTOM_SORT_FIELDS_TABLE')) { |
|
108 | + define('GEODIR_CUSTOM_SORT_FIELDS_TABLE', $plugin_prefix . 'custom_sort_fields'); |
|
109 | +} |
|
96 | 110 | |
97 | 111 | |
98 | 112 | if ($_SERVER['REQUEST_URI'] == '' || $_SERVER['REQUEST_URI'] == '/') { |
@@ -107,7 +121,9 @@ discard block |
||
107 | 121 | /* |
108 | 122 | * Localisation items. |
109 | 123 | */ |
110 | -if (!defined('GEODIRECTORY_TEXTDOMAIN')) define('GEODIRECTORY_TEXTDOMAIN', 'geodirectory'); |
|
124 | +if (!defined('GEODIRECTORY_TEXTDOMAIN')) { |
|
125 | + define('GEODIRECTORY_TEXTDOMAIN', 'geodirectory'); |
|
126 | +} |
|
111 | 127 | |
112 | 128 | // Load geodirectory plugin textdomain. |
113 | 129 | add_action( 'plugins_loaded', 'geodir_load_textdomain' ); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * This tries to disable cache on homepage as it can be very dynamic. |
101 | 101 | */ |
102 | 102 | define('DONOTCACHEPAGE', TRUE); |
103 | - $_SERVER['DONOTCACHEPAGE']= TRUE; |
|
103 | + $_SERVER['DONOTCACHEPAGE'] = TRUE; |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | if (!defined('GEODIRECTORY_TEXTDOMAIN')) define('GEODIRECTORY_TEXTDOMAIN', 'geodirectory'); |
111 | 111 | |
112 | 112 | // Load geodirectory plugin textdomain. |
113 | -add_action( 'plugins_loaded', 'geodir_load_textdomain' ); |
|
113 | +add_action('plugins_loaded', 'geodir_load_textdomain'); |
|
114 | 114 | |
115 | 115 | /* |
116 | 116 | * A function to log GD errors no matter the type given. |
@@ -121,18 +121,18 @@ discard block |
||
121 | 121 | * @param mixed $log The thing that should be logged. |
122 | 122 | * @package GeoDirectory |
123 | 123 | */ |
124 | -function geodir_error_log($log){ |
|
124 | +function geodir_error_log($log) { |
|
125 | 125 | /* |
126 | 126 | * A filter to override the WP_DEBUG setting for function geodir_error_log(). |
127 | 127 | * |
128 | 128 | * @since 1.5.7 |
129 | 129 | */ |
130 | - $should_log = apply_filters( 'geodir_log_errors', WP_DEBUG); |
|
131 | - if ( true === $should_log ) { |
|
132 | - if ( is_array( $log ) || is_object( $log ) ) { |
|
133 | - error_log( print_r( $log, true ) ); |
|
130 | + $should_log = apply_filters('geodir_log_errors', WP_DEBUG); |
|
131 | + if (true === $should_log) { |
|
132 | + if (is_array($log) || is_object($log)) { |
|
133 | + error_log(print_r($log, true)); |
|
134 | 134 | } else { |
135 | - error_log( $log ); |
|
135 | + error_log($log); |
|
136 | 136 | } |
137 | 137 | } |
138 | 138 | } |
@@ -225,11 +225,11 @@ discard block |
||
225 | 225 | // if ( 'plugins.php' === $pagenow ) |
226 | 226 | { |
227 | 227 | // Better update message |
228 | - $file = basename( __FILE__ ); |
|
229 | - $folder = basename( dirname( __FILE__ ) ); |
|
228 | + $file = basename(__FILE__); |
|
229 | + $folder = basename(dirname(__FILE__)); |
|
230 | 230 | $hook = "in_plugin_update_message-{$folder}/{$file}"; |
231 | 231 | //echo $hook; |
232 | - add_action( 'in_plugin_update_message-geodirectory/geodirectory.php', 'geodire_admin_upgrade_notice', 20, 2 ); |
|
232 | + add_action('in_plugin_update_message-geodirectory/geodirectory.php', 'geodire_admin_upgrade_notice', 20, 2); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | 'autozoom' => '', |
111 | 111 | 'child_collapse' => '0', |
112 | 112 | 'scrollwheel' => '0', |
113 | - 'marker_cluster' => false, |
|
113 | + 'marker_cluster' => false, |
|
114 | 114 | 'latitude' => '', |
115 | 115 | 'longitude' => '' |
116 | 116 | ); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | * Filter the widget maptype of the map on home/listings page. |
143 | 143 | * |
144 | 144 | * @since 1.0.0 |
145 | - * @since 1.5.2 Added TERRAIN map type. |
|
145 | + * @since 1.5.2 Added TERRAIN map type. |
|
146 | 146 | * @param string $params['maptype'] The map type. Can be ROADMAP | SATELLITE | HYBRID | TERRAIN. |
147 | 147 | */ |
148 | 148 | 'maptype' => apply_filters('widget_maptype', $params['maptype']), |
@@ -199,8 +199,8 @@ discard block |
||
199 | 199 | 'is_geodir_home_map_widget' => true, |
200 | 200 | ); |
201 | 201 | |
202 | - // Add marker cluster |
|
203 | - if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) { |
|
202 | + // Add marker cluster |
|
203 | + if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) { |
|
204 | 204 | $map_args['enable_marker_cluster'] = true; |
205 | 205 | if(get_option('geodir_marker_cluster_type')) { |
206 | 206 | if ($map_args['autozoom']) { |
@@ -212,9 +212,9 @@ discard block |
||
212 | 212 | $map_args['enable_marker_cluster_server'] = true ; |
213 | 213 | |
214 | 214 | } |
215 | - } else { |
|
216 | - $map_args['enable_marker_cluster'] = false; |
|
217 | - } |
|
215 | + } else { |
|
216 | + $map_args['enable_marker_cluster'] = false; |
|
217 | + } |
|
218 | 218 | |
219 | 219 | // if lat and long set in shortcode, hack it so the map is not repositioned |
220 | 220 | if(!empty($params['latitude']) && !empty($params['longitude']) ){ |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | 'scrollwheel' => '0', |
282 | 282 | 'maptype' => 'ROADMAP', |
283 | 283 | 'child_collapse' => 0, |
284 | - 'marker_cluster' => false |
|
284 | + 'marker_cluster' => false |
|
285 | 285 | ); |
286 | 286 | |
287 | 287 | $params = shortcode_atts($defaults, $atts); |
@@ -336,12 +336,12 @@ discard block |
||
336 | 336 | $map_args['maxZoom'] = 21; |
337 | 337 | $map_args['bubble_size'] = 'small'; |
338 | 338 | |
339 | - // Add marker cluster |
|
340 | - if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) { |
|
341 | - $map_args['enable_marker_cluster'] = true; |
|
342 | - } else { |
|
343 | - $map_args['enable_marker_cluster'] = false; |
|
344 | - } |
|
339 | + // Add marker cluster |
|
340 | + if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) { |
|
341 | + $map_args['enable_marker_cluster'] = true; |
|
342 | + } else { |
|
343 | + $map_args['enable_marker_cluster'] = false; |
|
344 | + } |
|
345 | 345 | |
346 | 346 | geodir_draw_map($map_args); |
347 | 347 | |
@@ -572,12 +572,12 @@ discard block |
||
572 | 572 | 'before_title' => '', |
573 | 573 | 'after_title' => '', |
574 | 574 | 'title' => '', |
575 | - 'default_post_type' => '', |
|
575 | + 'default_post_type' => '', |
|
576 | 576 | ); |
577 | 577 | |
578 | 578 | $params = shortcode_atts($defaults, $atts, 'popular_post_category'); |
579 | 579 | $params['category_limit'] = absint($params['category_limit']); |
580 | - $params['default_post_type'] = gdsc_is_post_type_valid($params['default_post_type']) ? $params['default_post_type'] : ''; |
|
580 | + $params['default_post_type'] = gdsc_is_post_type_valid($params['default_post_type']) ? $params['default_post_type'] : ''; |
|
581 | 581 | geodir_popular_post_category_output($params, $params); |
582 | 582 | |
583 | 583 | $output = ob_get_contents(); |
@@ -738,8 +738,8 @@ discard block |
||
738 | 738 | function geodir_sc_recent_reviews($atts) { |
739 | 739 | ob_start(); |
740 | 740 | $defaults = array( |
741 | - 'title' => '', |
|
742 | - 'count' => 5, |
|
741 | + 'title' => '', |
|
742 | + 'count' => 5, |
|
743 | 743 | ); |
744 | 744 | |
745 | 745 | $params = shortcode_atts($defaults, $atts); |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | $count = 1; |
750 | 750 | } |
751 | 751 | |
752 | - $title = !empty($params['title']) ? __($params['title'], 'geodirectory') : ''; |
|
752 | + $title = !empty($params['title']) ? __($params['title'], 'geodirectory') : ''; |
|
753 | 753 | |
754 | 754 | $comments_li = geodir_get_recent_reviews(30, $count, 100, false); |
755 | 755 | |
@@ -878,34 +878,34 @@ discard block |
||
878 | 878 | */ |
879 | 879 | function geodir_sc_advanced_search($atts) { |
880 | 880 | $defaults = array( |
881 | - 'title' => '', |
|
882 | - 'before_widget' => '<section id="geodir_advanced_search-1" class="widget geodir-widget geodir_advanced_search_widget">', |
|
881 | + 'title' => '', |
|
882 | + 'before_widget' => '<section id="geodir_advanced_search-1" class="widget geodir-widget geodir_advanced_search_widget">', |
|
883 | 883 | 'after_widget' => '</section>', |
884 | 884 | 'before_title' => '<h3 class="widget-title">', |
885 | 885 | 'after_title' => '</h3>', |
886 | - 'show_adv_search' => 'default' |
|
887 | - ); |
|
886 | + 'show_adv_search' => 'default' |
|
887 | + ); |
|
888 | 888 | |
889 | - $params = shortcode_atts($defaults, $atts); |
|
889 | + $params = shortcode_atts($defaults, $atts); |
|
890 | 890 | |
891 | - $show_adv_search = isset($params['show_adv_search']) && in_array($params['show_adv_search'], array('default', 'always', 'searched')) ? $params['show_adv_search'] : ''; |
|
891 | + $show_adv_search = isset($params['show_adv_search']) && in_array($params['show_adv_search'], array('default', 'always', 'searched')) ? $params['show_adv_search'] : ''; |
|
892 | 892 | |
893 | - if ($show_adv_search != '' ) { |
|
894 | - $show_adv_class = 'geodir-advance-search-' . $show_adv_search . ' '; |
|
895 | - if ($show_adv_search == 'searched' && geodir_is_page('search')) { |
|
896 | - $show_adv_search = 'search'; |
|
897 | - } |
|
898 | - $show_adv_attrs = 'data-show-adv="' . $show_adv_search . '"'; |
|
893 | + if ($show_adv_search != '' ) { |
|
894 | + $show_adv_class = 'geodir-advance-search-' . $show_adv_search . ' '; |
|
895 | + if ($show_adv_search == 'searched' && geodir_is_page('search')) { |
|
896 | + $show_adv_search = 'search'; |
|
897 | + } |
|
898 | + $show_adv_attrs = 'data-show-adv="' . $show_adv_search . '"'; |
|
899 | 899 | |
900 | - $params['before_widget'] = str_replace('class="', $show_adv_attrs . ' class="' . $show_adv_class, $params['before_widget']); |
|
901 | - } |
|
900 | + $params['before_widget'] = str_replace('class="', $show_adv_attrs . ' class="' . $show_adv_class, $params['before_widget']); |
|
901 | + } |
|
902 | 902 | |
903 | - ob_start(); |
|
903 | + ob_start(); |
|
904 | 904 | |
905 | - //geodir_get_template_part('listing', 'filter-form'); |
|
906 | - the_widget('geodir_advance_search_widget', $params, $params ); |
|
905 | + //geodir_get_template_part('listing', 'filter-form'); |
|
906 | + the_widget('geodir_advance_search_widget', $params, $params ); |
|
907 | 907 | |
908 | - $output = ob_get_contents(); |
|
908 | + $output = ob_get_contents(); |
|
909 | 909 | ob_end_clean(); |
910 | 910 | |
911 | 911 | return $output; |
@@ -944,21 +944,21 @@ discard block |
||
944 | 944 | * @return string HTML content to display best of listings. |
945 | 945 | */ |
946 | 946 | function geodir_sc_bestof_widget($atts, $content = '') { |
947 | - $defaults = array( |
|
948 | - 'title' => '', |
|
949 | - 'post_type' => 'gd_place', |
|
950 | - 'post_limit' => 5, |
|
951 | - 'categ_limit' => 3, |
|
952 | - 'character_count' => 20, |
|
953 | - 'use_viewing_post_type' => '1', |
|
954 | - 'add_location_filter' => '1', |
|
955 | - 'tab_layout' => 'bestof-tabs-on-top', |
|
956 | - 'before_widget' => '<section id="bestof_widget-1" class="widget geodir-widget geodir_bestof_widget geodir_sc_bestof_widget">', |
|
947 | + $defaults = array( |
|
948 | + 'title' => '', |
|
949 | + 'post_type' => 'gd_place', |
|
950 | + 'post_limit' => 5, |
|
951 | + 'categ_limit' => 3, |
|
952 | + 'character_count' => 20, |
|
953 | + 'use_viewing_post_type' => '1', |
|
954 | + 'add_location_filter' => '1', |
|
955 | + 'tab_layout' => 'bestof-tabs-on-top', |
|
956 | + 'before_widget' => '<section id="bestof_widget-1" class="widget geodir-widget geodir_bestof_widget geodir_sc_bestof_widget">', |
|
957 | 957 | 'after_widget' => '</section>', |
958 | 958 | 'before_title' => '<h3 class="widget-title">', |
959 | 959 | 'after_title' => '</h3>', |
960 | - ); |
|
961 | - $params = shortcode_atts($defaults, $atts); |
|
960 | + ); |
|
961 | + $params = shortcode_atts($defaults, $atts); |
|
962 | 962 | |
963 | 963 | /** |
964 | 964 | * Validate our incoming params |
@@ -969,29 +969,29 @@ discard block |
||
969 | 969 | $params['post_type'] = 'gd_place'; |
970 | 970 | } |
971 | 971 | |
972 | - // Post limit needs to be a positive integer |
|
972 | + // Post limit needs to be a positive integer |
|
973 | 973 | $params['post_limit'] = absint($params['post_limit']); |
974 | 974 | if (0 == $params['post_limit']) { |
975 | 975 | $params['post_limit'] = 5; |
976 | 976 | } |
977 | 977 | |
978 | - // Category limit needs to be a positive integer |
|
978 | + // Category limit needs to be a positive integer |
|
979 | 979 | $params['categ_limit'] = absint($params['categ_limit']); |
980 | 980 | if (0 == $params['categ_limit']) { |
981 | 981 | $params['categ_limit'] = 3; |
982 | 982 | } |
983 | 983 | |
984 | - // Tab layout validation |
|
984 | + // Tab layout validation |
|
985 | 985 | $params['tab_layout'] = $params['tab_layout']; |
986 | 986 | if (!in_array($params['tab_layout'], array('bestof-tabs-on-top', 'bestof-tabs-on-left', 'bestof-tabs-as-dropdown'))) { |
987 | 987 | $params['tab_layout'] = 'bestof-tabs-on-top'; |
988 | 988 | } |
989 | 989 | |
990 | - // Validate character_count |
|
990 | + // Validate character_count |
|
991 | 991 | $params['character_count'] = $params['character_count']; |
992 | 992 | |
993 | - ob_start(); |
|
994 | - the_widget('geodir_bestof_widget', $params, $params); |
|
993 | + ob_start(); |
|
994 | + the_widget('geodir_bestof_widget', $params, $params); |
|
995 | 995 | $output = ob_get_contents(); |
996 | 996 | ob_end_clean(); |
997 | 997 | |
@@ -1036,31 +1036,31 @@ discard block |
||
1036 | 1036 | * @return string HTML content to display geodirectory listings. |
1037 | 1037 | */ |
1038 | 1038 | function geodir_sc_gd_listings($atts, $content = '') { |
1039 | - $defaults = array( |
|
1040 | - 'title' => '', |
|
1041 | - 'post_type' => 'gd_place', |
|
1042 | - 'category' => 0, |
|
1043 | - 'list_sort' => 'latest', |
|
1044 | - 'event_type' => '', |
|
1045 | - 'post_number' => 10, |
|
1046 | - 'layout' => 'gridview_onehalf', |
|
1047 | - 'listing_width' => '', |
|
1048 | - 'character_count' => 20, |
|
1049 | - 'add_location_filter' => 1, |
|
1050 | - 'show_featured_only' => '', |
|
1051 | - 'show_special_only' => '', |
|
1052 | - 'with_pics_only' => '', |
|
1053 | - 'with_videos_only' => '', |
|
1054 | - 'with_pagination' => '1', |
|
1055 | - 'top_pagination' => '0', |
|
1056 | - 'bottom_pagination' => '1', |
|
1057 | - ); |
|
1058 | - $params = shortcode_atts($defaults, $atts); |
|
1059 | - |
|
1060 | - $params['title'] = wp_strip_all_tags($params['title']); |
|
1039 | + $defaults = array( |
|
1040 | + 'title' => '', |
|
1041 | + 'post_type' => 'gd_place', |
|
1042 | + 'category' => 0, |
|
1043 | + 'list_sort' => 'latest', |
|
1044 | + 'event_type' => '', |
|
1045 | + 'post_number' => 10, |
|
1046 | + 'layout' => 'gridview_onehalf', |
|
1047 | + 'listing_width' => '', |
|
1048 | + 'character_count' => 20, |
|
1049 | + 'add_location_filter' => 1, |
|
1050 | + 'show_featured_only' => '', |
|
1051 | + 'show_special_only' => '', |
|
1052 | + 'with_pics_only' => '', |
|
1053 | + 'with_videos_only' => '', |
|
1054 | + 'with_pagination' => '1', |
|
1055 | + 'top_pagination' => '0', |
|
1056 | + 'bottom_pagination' => '1', |
|
1057 | + ); |
|
1058 | + $params = shortcode_atts($defaults, $atts); |
|
1059 | + |
|
1060 | + $params['title'] = wp_strip_all_tags($params['title']); |
|
1061 | 1061 | $params['post_type'] = gdsc_is_post_type_valid($params['post_type']) ? $params['post_type'] : 'gd_place'; |
1062 | 1062 | |
1063 | - // Validate the selected category/ies - Grab the current list based on post_type |
|
1063 | + // Validate the selected category/ies - Grab the current list based on post_type |
|
1064 | 1064 | $category_taxonomy = geodir_get_taxonomies($params['post_type']); |
1065 | 1065 | $categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'fields' => 'ids')); |
1066 | 1066 | |
@@ -1073,15 +1073,15 @@ discard block |
||
1073 | 1073 | // Otherwise it becomes empty and later on that will mean "All" |
1074 | 1074 | $params['category'] = array_intersect($params['category'], $categories); |
1075 | 1075 | |
1076 | - // Post_number needs to be a positive integer |
|
1076 | + // Post_number needs to be a positive integer |
|
1077 | 1077 | $params['post_number'] = absint($params['post_number']); |
1078 | 1078 | $params['post_number'] = $params['post_number'] > 0 ? $params['post_number'] : 10; |
1079 | 1079 | |
1080 | - // Validate character_count |
|
1080 | + // Validate character_count |
|
1081 | 1081 | //todo: is this necessary? |
1082 | 1082 | $params['character_count'] = $params['character_count']; |
1083 | 1083 | |
1084 | - // Validate our layout choice |
|
1084 | + // Validate our layout choice |
|
1085 | 1085 | // Outside of the norm, I added some more simple terms to match the existing |
1086 | 1086 | // So now I just run the switch to set it properly. |
1087 | 1087 | $params['layout'] = gdsc_validate_layout_choice($params['layout']); |
@@ -1089,7 +1089,7 @@ discard block |
||
1089 | 1089 | // Validate our sorting choice |
1090 | 1090 | $params['list_sort'] = gdsc_validate_sort_choice($params['list_sort']); |
1091 | 1091 | |
1092 | - // Validate Listing width, used in the template widget-listing-listview.php |
|
1092 | + // Validate Listing width, used in the template widget-listing-listview.php |
|
1093 | 1093 | // The context is in width=$listing_width% - So we need a positive number between 0 & 100 |
1094 | 1094 | $params['listing_width'] = gdsc_validate_listing_width($params['listing_width']); |
1095 | 1095 | |
@@ -1099,24 +1099,24 @@ discard block |
||
1099 | 1099 | $params['show_special_only'] = gdsc_to_bool_val($params['show_special_only']); |
1100 | 1100 | $params['with_pics_only'] = gdsc_to_bool_val($params['with_pics_only']); |
1101 | 1101 | $params['with_videos_only'] = gdsc_to_bool_val($params['with_videos_only']); |
1102 | - $params['with_pagination'] = gdsc_to_bool_val($params['with_pagination']); |
|
1103 | - $params['top_pagination'] = gdsc_to_bool_val($params['top_pagination']); |
|
1104 | - $params['bottom_pagination'] = gdsc_to_bool_val($params['bottom_pagination']); |
|
1102 | + $params['with_pagination'] = gdsc_to_bool_val($params['with_pagination']); |
|
1103 | + $params['top_pagination'] = gdsc_to_bool_val($params['top_pagination']); |
|
1104 | + $params['bottom_pagination'] = gdsc_to_bool_val($params['bottom_pagination']); |
|
1105 | 1105 | |
1106 | 1106 | /** |
1107 | 1107 | * End of validation |
1108 | 1108 | */ |
1109 | - if (isset($atts['geodir_ajax'])) { |
|
1110 | - $params['geodir_ajax'] = $atts['geodir_ajax']; |
|
1111 | - unset($atts['geodir_ajax']); |
|
1112 | - } |
|
1113 | - if (isset($atts['pageno'])) { |
|
1114 | - $params['pageno'] = $atts['pageno']; |
|
1115 | - unset($atts['pageno']); |
|
1116 | - } |
|
1117 | - $params['shortcode_atts'] = $atts; |
|
1118 | - |
|
1119 | - $output = geodir_sc_gd_listings_output($params); |
|
1109 | + if (isset($atts['geodir_ajax'])) { |
|
1110 | + $params['geodir_ajax'] = $atts['geodir_ajax']; |
|
1111 | + unset($atts['geodir_ajax']); |
|
1112 | + } |
|
1113 | + if (isset($atts['pageno'])) { |
|
1114 | + $params['pageno'] = $atts['pageno']; |
|
1115 | + unset($atts['pageno']); |
|
1116 | + } |
|
1117 | + $params['shortcode_atts'] = $atts; |
|
1118 | + |
|
1119 | + $output = geodir_sc_gd_listings_output($params); |
|
1120 | 1120 | |
1121 | 1121 | return $output; |
1122 | 1122 | } |
@@ -1155,47 +1155,47 @@ discard block |
||
1155 | 1155 | * @return string HTML content to display CPT categories. |
1156 | 1156 | */ |
1157 | 1157 | function geodir_sc_cpt_categories_widget($atts, $content = '') { |
1158 | - $defaults = array( |
|
1159 | - 'title' => '', |
|
1160 | - 'post_type' => '', // NULL for all |
|
1161 | - 'hide_empty' => '', |
|
1162 | - 'show_count' => '', |
|
1163 | - 'hide_icon' => '', |
|
1164 | - 'cpt_left' => '', |
|
1165 | - 'sort_by' => 'count', |
|
1166 | - 'max_count' => 'all', |
|
1167 | - 'max_level' => '1', |
|
1168 | - 'before_widget' => '<section id="geodir_cpt_categories_widget-1" class="widget geodir-widget geodir_cpt_categories_widget geodir_sc_cpt_categories_widget">', |
|
1158 | + $defaults = array( |
|
1159 | + 'title' => '', |
|
1160 | + 'post_type' => '', // NULL for all |
|
1161 | + 'hide_empty' => '', |
|
1162 | + 'show_count' => '', |
|
1163 | + 'hide_icon' => '', |
|
1164 | + 'cpt_left' => '', |
|
1165 | + 'sort_by' => 'count', |
|
1166 | + 'max_count' => 'all', |
|
1167 | + 'max_level' => '1', |
|
1168 | + 'before_widget' => '<section id="geodir_cpt_categories_widget-1" class="widget geodir-widget geodir_cpt_categories_widget geodir_sc_cpt_categories_widget">', |
|
1169 | 1169 | 'after_widget' => '</section>', |
1170 | 1170 | 'before_title' => '<h3 class="widget-title">', |
1171 | 1171 | 'after_title' => '</h3>', |
1172 | - ); |
|
1173 | - $params = shortcode_atts($defaults, $atts); |
|
1172 | + ); |
|
1173 | + $params = shortcode_atts($defaults, $atts); |
|
1174 | 1174 | |
1175 | 1175 | /** |
1176 | 1176 | * Validate our incoming params |
1177 | 1177 | */ |
1178 | - // Make sure we have an array |
|
1178 | + // Make sure we have an array |
|
1179 | 1179 | $params['post_type'] = !is_array($params['post_type']) && trim($params['post_type']) != '' ? explode(',', trim($params['post_type'])) : array(); |
1180 | 1180 | |
1181 | - // Validate the checkboxes used on the widget |
|
1181 | + // Validate the checkboxes used on the widget |
|
1182 | 1182 | $params['hide_empty'] = gdsc_to_bool_val($params['hide_empty']); |
1183 | 1183 | $params['show_count'] = gdsc_to_bool_val($params['show_count']); |
1184 | 1184 | $params['hide_icon'] = gdsc_to_bool_val($params['hide_icon']); |
1185 | 1185 | $params['cpt_left'] = gdsc_to_bool_val($params['cpt_left']); |
1186 | 1186 | |
1187 | - if ($params['max_count'] != 'all') { |
|
1188 | - $params['max_count'] = absint($params['max_count']); |
|
1189 | - } |
|
1187 | + if ($params['max_count'] != 'all') { |
|
1188 | + $params['max_count'] = absint($params['max_count']); |
|
1189 | + } |
|
1190 | 1190 | |
1191 | - if ($params['max_level'] != 'all') { |
|
1192 | - $params['max_level'] = absint($params['max_level']); |
|
1193 | - } |
|
1191 | + if ($params['max_level'] != 'all') { |
|
1192 | + $params['max_level'] = absint($params['max_level']); |
|
1193 | + } |
|
1194 | 1194 | |
1195 | - $params['sort_by'] = $params['sort_by'] == 'az' ? 'az' : 'count'; |
|
1195 | + $params['sort_by'] = $params['sort_by'] == 'az' ? 'az' : 'count'; |
|
1196 | 1196 | |
1197 | - ob_start(); |
|
1198 | - the_widget('geodir_cpt_categories_widget', $params, $params); |
|
1197 | + ob_start(); |
|
1198 | + the_widget('geodir_cpt_categories_widget', $params, $params); |
|
1199 | 1199 | $output = ob_get_contents(); |
1200 | 1200 | ob_end_clean(); |
1201 | 1201 |
@@ -202,14 +202,14 @@ discard block |
||
202 | 202 | // Add marker cluster |
203 | 203 | if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) { |
204 | 204 | $map_args['enable_marker_cluster'] = true; |
205 | - if(get_option('geodir_marker_cluster_type')) { |
|
205 | + if (get_option('geodir_marker_cluster_type')) { |
|
206 | 206 | if ($map_args['autozoom']) { |
207 | 207 | $map_args['enable_marker_cluster_no_reposition'] = false; |
208 | 208 | } else { |
209 | 209 | $map_args['enable_marker_cluster_no_reposition'] = true; |
210 | 210 | } |
211 | 211 | |
212 | - $map_args['enable_marker_cluster_server'] = true ; |
|
212 | + $map_args['enable_marker_cluster_server'] = true; |
|
213 | 213 | |
214 | 214 | } |
215 | 215 | } else { |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | } |
218 | 218 | |
219 | 219 | // if lat and long set in shortcode, hack it so the map is not repositioned |
220 | - if(!empty($params['latitude']) && !empty($params['longitude']) ){ |
|
220 | + if (!empty($params['latitude']) && !empty($params['longitude'])) { |
|
221 | 221 | $map_args['enable_marker_cluster_no_reposition'] = true; |
222 | 222 | } |
223 | 223 | |
@@ -890,7 +890,7 @@ discard block |
||
890 | 890 | |
891 | 891 | $show_adv_search = isset($params['show_adv_search']) && in_array($params['show_adv_search'], array('default', 'always', 'searched')) ? $params['show_adv_search'] : ''; |
892 | 892 | |
893 | - if ($show_adv_search != '' ) { |
|
893 | + if ($show_adv_search != '') { |
|
894 | 894 | $show_adv_class = 'geodir-advance-search-' . $show_adv_search . ' '; |
895 | 895 | if ($show_adv_search == 'searched' && geodir_is_page('search')) { |
896 | 896 | $show_adv_search = 'search'; |
@@ -903,7 +903,7 @@ discard block |
||
903 | 903 | ob_start(); |
904 | 904 | |
905 | 905 | //geodir_get_template_part('listing', 'filter-form'); |
906 | - the_widget('geodir_advance_search_widget', $params, $params ); |
|
906 | + the_widget('geodir_advance_search_widget', $params, $params); |
|
907 | 907 | |
908 | 908 | $output = ob_get_contents(); |
909 | 909 | ob_end_clean(); |
@@ -1057,12 +1057,12 @@ discard block |
||
1057 | 1057 | ); |
1058 | 1058 | $params = shortcode_atts($defaults, $atts); |
1059 | 1059 | |
1060 | - $params['title'] = wp_strip_all_tags($params['title']); |
|
1061 | - $params['post_type'] = gdsc_is_post_type_valid($params['post_type']) ? $params['post_type'] : 'gd_place'; |
|
1060 | + $params['title'] = wp_strip_all_tags($params['title']); |
|
1061 | + $params['post_type'] = gdsc_is_post_type_valid($params['post_type']) ? $params['post_type'] : 'gd_place'; |
|
1062 | 1062 | |
1063 | 1063 | // Validate the selected category/ies - Grab the current list based on post_type |
1064 | - $category_taxonomy = geodir_get_taxonomies($params['post_type']); |
|
1065 | - $categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'fields' => 'ids')); |
|
1064 | + $category_taxonomy = geodir_get_taxonomies($params['post_type']); |
|
1065 | + $categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'fields' => 'ids')); |
|
1066 | 1066 | |
1067 | 1067 | // Make sure we have an array |
1068 | 1068 | if (!(is_array($params['category']))) { |
@@ -1071,37 +1071,37 @@ discard block |
||
1071 | 1071 | |
1072 | 1072 | // Array_intersect returns only the items in $params['category'] that are also in our category list |
1073 | 1073 | // Otherwise it becomes empty and later on that will mean "All" |
1074 | - $params['category'] = array_intersect($params['category'], $categories); |
|
1074 | + $params['category'] = array_intersect($params['category'], $categories); |
|
1075 | 1075 | |
1076 | 1076 | // Post_number needs to be a positive integer |
1077 | - $params['post_number'] = absint($params['post_number']); |
|
1078 | - $params['post_number'] = $params['post_number'] > 0 ? $params['post_number'] : 10; |
|
1077 | + $params['post_number'] = absint($params['post_number']); |
|
1078 | + $params['post_number'] = $params['post_number'] > 0 ? $params['post_number'] : 10; |
|
1079 | 1079 | |
1080 | 1080 | // Validate character_count |
1081 | 1081 | //todo: is this necessary? |
1082 | - $params['character_count'] = $params['character_count']; |
|
1082 | + $params['character_count'] = $params['character_count']; |
|
1083 | 1083 | |
1084 | 1084 | // Validate our layout choice |
1085 | 1085 | // Outside of the norm, I added some more simple terms to match the existing |
1086 | 1086 | // So now I just run the switch to set it properly. |
1087 | - $params['layout'] = gdsc_validate_layout_choice($params['layout']); |
|
1087 | + $params['layout'] = gdsc_validate_layout_choice($params['layout']); |
|
1088 | 1088 | |
1089 | 1089 | // Validate our sorting choice |
1090 | - $params['list_sort'] = gdsc_validate_sort_choice($params['list_sort']); |
|
1090 | + $params['list_sort'] = gdsc_validate_sort_choice($params['list_sort']); |
|
1091 | 1091 | |
1092 | 1092 | // Validate Listing width, used in the template widget-listing-listview.php |
1093 | 1093 | // The context is in width=$listing_width% - So we need a positive number between 0 & 100 |
1094 | - $params['listing_width'] = gdsc_validate_listing_width($params['listing_width']); |
|
1094 | + $params['listing_width'] = gdsc_validate_listing_width($params['listing_width']); |
|
1095 | 1095 | |
1096 | 1096 | // Validate the checkboxes used on the widget |
1097 | - $params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']); |
|
1098 | - $params['show_featured_only'] = gdsc_to_bool_val($params['show_featured_only']); |
|
1099 | - $params['show_special_only'] = gdsc_to_bool_val($params['show_special_only']); |
|
1100 | - $params['with_pics_only'] = gdsc_to_bool_val($params['with_pics_only']); |
|
1101 | - $params['with_videos_only'] = gdsc_to_bool_val($params['with_videos_only']); |
|
1102 | - $params['with_pagination'] = gdsc_to_bool_val($params['with_pagination']); |
|
1103 | - $params['top_pagination'] = gdsc_to_bool_val($params['top_pagination']); |
|
1104 | - $params['bottom_pagination'] = gdsc_to_bool_val($params['bottom_pagination']); |
|
1097 | + $params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']); |
|
1098 | + $params['show_featured_only'] = gdsc_to_bool_val($params['show_featured_only']); |
|
1099 | + $params['show_special_only'] = gdsc_to_bool_val($params['show_special_only']); |
|
1100 | + $params['with_pics_only'] = gdsc_to_bool_val($params['with_pics_only']); |
|
1101 | + $params['with_videos_only'] = gdsc_to_bool_val($params['with_videos_only']); |
|
1102 | + $params['with_pagination'] = gdsc_to_bool_val($params['with_pagination']); |
|
1103 | + $params['top_pagination'] = gdsc_to_bool_val($params['top_pagination']); |
|
1104 | + $params['bottom_pagination'] = gdsc_to_bool_val($params['bottom_pagination']); |
|
1105 | 1105 | |
1106 | 1106 | /** |
1107 | 1107 | * End of validation |
@@ -1114,7 +1114,7 @@ discard block |
||
1114 | 1114 | $params['pageno'] = $atts['pageno']; |
1115 | 1115 | unset($atts['pageno']); |
1116 | 1116 | } |
1117 | - $params['shortcode_atts'] = $atts; |
|
1117 | + $params['shortcode_atts'] = $atts; |
|
1118 | 1118 | |
1119 | 1119 | $output = geodir_sc_gd_listings_output($params); |
1120 | 1120 | |
@@ -1181,8 +1181,8 @@ discard block |
||
1181 | 1181 | // Validate the checkboxes used on the widget |
1182 | 1182 | $params['hide_empty'] = gdsc_to_bool_val($params['hide_empty']); |
1183 | 1183 | $params['show_count'] = gdsc_to_bool_val($params['show_count']); |
1184 | - $params['hide_icon'] = gdsc_to_bool_val($params['hide_icon']); |
|
1185 | - $params['cpt_left'] = gdsc_to_bool_val($params['cpt_left']); |
|
1184 | + $params['hide_icon'] = gdsc_to_bool_val($params['hide_icon']); |
|
1185 | + $params['cpt_left'] = gdsc_to_bool_val($params['cpt_left']); |
|
1186 | 1186 | |
1187 | 1187 | if ($params['max_count'] != 'all') { |
1188 | 1188 | $params['max_count'] = absint($params['max_count']); |
@@ -247,13 +247,14 @@ discard block |
||
247 | 247 | */ |
248 | 248 | function geodir_add_async_forscript($url) |
249 | 249 | { |
250 | - if (strpos($url, '#asyncload')===false) |
|
251 | - return $url; |
|
252 | - else if (is_admin()) |
|
253 | - return str_replace('#asyncload', '', $url); |
|
254 | - else |
|
255 | - return str_replace('#asyncload', '', $url)."' async='async"; |
|
256 | -} |
|
250 | + if (strpos($url, '#asyncload')===false) { |
|
251 | + return $url; |
|
252 | + } else if (is_admin()) { |
|
253 | + return str_replace('#asyncload', '', $url); |
|
254 | + } else { |
|
255 | + return str_replace('#asyncload', '', $url)."' async='async"; |
|
256 | + } |
|
257 | + } |
|
257 | 258 | add_filter('clean_url', 'geodir_add_async_forscript', 11, 1); |
258 | 259 | |
259 | 260 | /** |
@@ -300,7 +301,7 @@ discard block |
||
300 | 301 | wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION); |
301 | 302 | wp_enqueue_style('geodir-chosen-style'); |
302 | 303 | |
303 | - }else{ |
|
304 | + } else{ |
|
304 | 305 | wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION); |
305 | 306 | wp_enqueue_style('geodir-core-scss'); |
306 | 307 | |
@@ -361,8 +362,10 @@ discard block |
||
361 | 362 | |
362 | 363 | $half_pages_to_show = round($pages_to_show / 2); |
363 | 364 | |
364 | - if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default pagination for geodirectory home page. |
|
365 | - return; |
|
365 | + if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) { |
|
366 | + // dont apply default pagination for geodirectory home page. |
|
367 | + return; |
|
368 | + } |
|
366 | 369 | |
367 | 370 | if (!is_single()) { |
368 | 371 | if (function_exists('geodir_location_geo_home_link')) { |
@@ -435,11 +438,21 @@ discard block |
||
435 | 438 | } |
436 | 439 | $dist_dif = 1000; |
437 | 440 | |
438 | - if ($dist <= 5000) $dist_dif = 500; |
|
439 | - if ($dist <= 1000) $dist_dif = 100; |
|
440 | - if ($dist <= 500) $dist_dif = 50; |
|
441 | - if ($dist <= 100) $dist_dif = 10; |
|
442 | - if ($dist <= 50) $dist_dif = 5; |
|
441 | + if ($dist <= 5000) { |
|
442 | + $dist_dif = 500; |
|
443 | + } |
|
444 | + if ($dist <= 1000) { |
|
445 | + $dist_dif = 100; |
|
446 | + } |
|
447 | + if ($dist <= 500) { |
|
448 | + $dist_dif = 50; |
|
449 | + } |
|
450 | + if ($dist <= 100) { |
|
451 | + $dist_dif = 10; |
|
452 | + } |
|
453 | + if ($dist <= 50) { |
|
454 | + $dist_dif = 5; |
|
455 | + } |
|
443 | 456 | |
444 | 457 | ?> |
445 | 458 | <script type="text/javascript"> |
@@ -501,18 +514,23 @@ discard block |
||
501 | 514 | { |
502 | 515 | |
503 | 516 | $default_search_for_text = SEARCH_FOR_TEXT; |
504 | - if (get_option('geodir_search_field_default_text')) |
|
505 | - $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory'); |
|
517 | + if (get_option('geodir_search_field_default_text')) { |
|
518 | + $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory'); |
|
519 | + } |
|
506 | 520 | |
507 | 521 | $default_near_text = NEAR_TEXT; |
508 | - if (get_option('geodir_near_field_default_text')) |
|
509 | - $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory'); |
|
522 | + if (get_option('geodir_near_field_default_text')) { |
|
523 | + $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory'); |
|
524 | + } |
|
510 | 525 | |
511 | 526 | ?> |
512 | 527 | |
513 | 528 | |
514 | 529 | <script type="text/javascript"> |
515 | - var default_location = '<?php if($search_location = geodir_get_default_location()) echo $search_location->city ;?>'; |
|
530 | + var default_location = '<?php if($search_location = geodir_get_default_location()) { |
|
531 | + echo $search_location->city ; |
|
532 | +} |
|
533 | +?>'; |
|
516 | 534 | var latlng; |
517 | 535 | var Sgeocoder; |
518 | 536 | var address; |
@@ -184,17 +184,17 @@ discard block |
||
184 | 184 | |
185 | 185 | wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
186 | 186 | if ($is_detail_page) { |
187 | - wp_enqueue_script('geodirectory-post-custom-js'); |
|
188 | - } |
|
187 | + wp_enqueue_script('geodirectory-post-custom-js'); |
|
188 | + } |
|
189 | 189 | |
190 | 190 | // font awesome rating script |
191 | - if (get_option('geodir_reviewrating_enable_font_awesome')) { |
|
192 | - wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true); |
|
193 | - wp_enqueue_script('geodir-barrating-js'); |
|
194 | - } else { // default rating script |
|
195 | - wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true); |
|
196 | - wp_enqueue_script('geodir-jRating-js'); |
|
197 | - } |
|
191 | + if (get_option('geodir_reviewrating_enable_font_awesome')) { |
|
192 | + wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true); |
|
193 | + wp_enqueue_script('geodir-barrating-js'); |
|
194 | + } else { // default rating script |
|
195 | + wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true); |
|
196 | + wp_enqueue_script('geodir-jRating-js'); |
|
197 | + } |
|
198 | 198 | |
199 | 199 | wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
200 | 200 | wp_enqueue_script('geodir-on-document-load'); |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | */ |
231 | 231 | function geodir_footer_scripts() |
232 | 232 | { |
233 | - echo stripslashes(get_option('geodir_ga_tracking_code')); |
|
233 | + echo stripslashes(get_option('geodir_ga_tracking_code')); |
|
234 | 234 | echo stripslashes(get_option('geodir_footer_scripts')); |
235 | 235 | } |
236 | 236 | |
@@ -363,9 +363,9 @@ discard block |
||
363 | 363 | return; |
364 | 364 | |
365 | 365 | if (!is_single()) { |
366 | - if (function_exists('geodir_location_geo_home_link')) { |
|
367 | - remove_filter('home_url', 'geodir_location_geo_home_link', 100000); |
|
368 | - } |
|
366 | + if (function_exists('geodir_location_geo_home_link')) { |
|
367 | + remove_filter('home_url', 'geodir_location_geo_home_link', 100000); |
|
368 | + } |
|
369 | 369 | $numposts = $wp_query->found_posts; |
370 | 370 | |
371 | 371 | |
@@ -376,22 +376,22 @@ discard block |
||
376 | 376 | } |
377 | 377 | |
378 | 378 | if ($max_page > 1 || $always_show) { |
379 | - // Extra pagination info |
|
380 | - $geodir_pagination_more_info = get_option('geodir_pagination_advance_info'); |
|
381 | - $start_no = ( $paged - 1 ) * $posts_per_page + 1; |
|
382 | - $end_no = min($paged * $posts_per_page, $numposts); |
|
379 | + // Extra pagination info |
|
380 | + $geodir_pagination_more_info = get_option('geodir_pagination_advance_info'); |
|
381 | + $start_no = ( $paged - 1 ) * $posts_per_page + 1; |
|
382 | + $end_no = min($paged * $posts_per_page, $numposts); |
|
383 | 383 | |
384 | - if ($geodir_pagination_more_info != '') { |
|
385 | - $pagination_info = '<div class="gd-pagination-details">' . wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts) . '</div>'; |
|
384 | + if ($geodir_pagination_more_info != '') { |
|
385 | + $pagination_info = '<div class="gd-pagination-details">' . wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts) . '</div>'; |
|
386 | 386 | |
387 | - if ($geodir_pagination_more_info == 'before') { |
|
388 | - $before = $before . $pagination_info; |
|
389 | - } else if ($geodir_pagination_more_info == 'after') { |
|
390 | - $after = $pagination_info . $after; |
|
391 | - } |
|
392 | - } |
|
387 | + if ($geodir_pagination_more_info == 'before') { |
|
388 | + $before = $before . $pagination_info; |
|
389 | + } else if ($geodir_pagination_more_info == 'after') { |
|
390 | + $after = $pagination_info . $after; |
|
391 | + } |
|
392 | + } |
|
393 | 393 | |
394 | - echo "$before <div class='Navi'>"; |
|
394 | + echo "$before <div class='Navi'>"; |
|
395 | 395 | if ($paged >= ($pages_to_show - 1)) { |
396 | 396 | echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link()) . '">«</a>'; |
397 | 397 | } |
@@ -412,9 +412,9 @@ discard block |
||
412 | 412 | echo "</div> $after"; |
413 | 413 | } |
414 | 414 | |
415 | - if (function_exists('geodir_location_geo_home_link')) { |
|
416 | - add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
|
417 | - } |
|
415 | + if (function_exists('geodir_location_geo_home_link')) { |
|
416 | + add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
|
417 | + } |
|
418 | 418 | } |
419 | 419 | } |
420 | 420 |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | { |
38 | 38 | $is_detail_page = false; |
39 | 39 | |
40 | - if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) { |
|
40 | + if ((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview'))) { |
|
41 | 41 | $is_detail_page = true; |
42 | 42 | } |
43 | 43 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | 'siteurl' => get_option('siteurl'), |
52 | 52 | 'geodir_plugin_url' => geodir_plugin_url(), |
53 | 53 | 'geodir_ajax_url' => geodir_get_ajax_url(), |
54 | - 'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'), |
|
54 | + 'geodir_gd_modal' => (int) get_option('geodir_disable_gb_modal'), |
|
55 | 55 | 'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue |
56 | 56 | ); |
57 | 57 | |
@@ -72,25 +72,25 @@ discard block |
||
72 | 72 | * |
73 | 73 | * } |
74 | 74 | */ |
75 | - $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data); |
|
75 | + $geodir_vars_data = apply_filters('geodir_vars_data', $geodir_vars_data); |
|
76 | 76 | |
77 | 77 | wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data); |
78 | 78 | |
79 | 79 | |
80 | 80 | |
81 | 81 | |
82 | - wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true); |
|
83 | - if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');} |
|
82 | + wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION, true); |
|
83 | + if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-flexslider-js'); } |
|
84 | 84 | |
85 | 85 | |
86 | 86 | |
87 | - wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true); |
|
87 | + wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION, true); |
|
88 | 88 | wp_enqueue_script('geodirectory-lightbox-jquery'); |
89 | 89 | |
90 | 90 | |
91 | 91 | |
92 | - wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true); |
|
93 | - if($is_detail_page){wp_enqueue_script('geodirectory-jquery-simplemodal');} |
|
92 | + wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION, true); |
|
93 | + if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-simplemodal'); } |
|
94 | 94 | |
95 | 95 | |
96 | 96 | //if( get_option('geodir_enqueue_google_api_script')==1) |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | wp_enqueue_script( 'geodirectory-googlemap-script' ); |
112 | 112 | } |
113 | 113 | */ |
114 | - wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true); |
|
114 | + wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true); |
|
115 | 115 | wp_enqueue_script('geodirectory-goMap-script'); |
116 | 116 | |
117 | 117 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | wp_enqueue_script('plupload-all'); |
134 | 134 | wp_enqueue_script('jquery-ui-sortable'); |
135 | 135 | |
136 | - wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true); |
|
136 | + wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
137 | 137 | wp_enqueue_script('geodirectory-plupload-script'); |
138 | 138 | |
139 | 139 | // SCRIPT FOR UPLOAD END |
@@ -245,12 +245,12 @@ discard block |
||
245 | 245 | */ |
246 | 246 | function geodir_add_async_forscript($url) |
247 | 247 | { |
248 | - if (strpos($url, '#asyncload')===false) |
|
248 | + if (strpos($url, '#asyncload') === false) |
|
249 | 249 | return $url; |
250 | 250 | else if (is_admin()) |
251 | 251 | return str_replace('#asyncload', '', $url); |
252 | 252 | else |
253 | - return str_replace('#asyncload', '', $url)."' async='async"; |
|
253 | + return str_replace('#asyncload', '', $url) . "' async='async"; |
|
254 | 254 | } |
255 | 255 | add_filter('clean_url', 'geodir_add_async_forscript', 11, 1); |
256 | 256 | |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | { |
265 | 265 | |
266 | 266 | |
267 | - if(get_option('geodir_scss_core')) { |
|
267 | + if (get_option('geodir_scss_core')) { |
|
268 | 268 | |
269 | 269 | |
270 | 270 | wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION); |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION); |
299 | 299 | wp_enqueue_style('geodir-chosen-style'); |
300 | 300 | |
301 | - }else{ |
|
301 | + } else { |
|
302 | 302 | wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION); |
303 | 303 | wp_enqueue_style('geodir-core-scss'); |
304 | 304 | |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | |
307 | 307 | } |
308 | 308 | |
309 | - if(is_rtl()){ |
|
309 | + if (is_rtl()) { |
|
310 | 310 | wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION); |
311 | 311 | wp_enqueue_style('geodirectory-frontend-rtl-style'); |
312 | 312 | } |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | if ($max_page > 1 || $always_show) { |
379 | 379 | // Extra pagination info |
380 | 380 | $geodir_pagination_more_info = get_option('geodir_pagination_advance_info'); |
381 | - $start_no = ( $paged - 1 ) * $posts_per_page + 1; |
|
381 | + $start_no = ($paged - 1) * $posts_per_page + 1; |
|
382 | 382 | $end_no = min($paged * $posts_per_page, $numposts); |
383 | 383 | |
384 | 384 | if ($geodir_pagination_more_info != '') { |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | jQuery(function ($) { |
446 | 446 | $("#distance_slider").slider({ |
447 | 447 | range: true, |
448 | - values: [0, <?php echo ($_REQUEST['sdist']!='') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>], |
|
448 | + values: [0, <?php echo ($_REQUEST['sdist'] != '') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>], |
|
449 | 449 | min: 0, |
450 | 450 | max: <?php echo $dist; ?>, |
451 | 451 | step: <?php echo $dist_dif; ?>, |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | |
511 | 511 | |
512 | 512 | <script type="text/javascript"> |
513 | - var default_location = '<?php if($search_location = geodir_get_default_location()) echo $search_location->city ;?>'; |
|
513 | + var default_location = '<?php if ($search_location = geodir_get_default_location()) echo $search_location->city; ?>'; |
|
514 | 514 | var latlng; |
515 | 515 | var Sgeocoder; |
516 | 516 | var address; |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | var $form = jQuery(this).closest('form'); |
524 | 524 | |
525 | 525 | if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val(); |
526 | - if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s); |
|
526 | + if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s); |
|
527 | 527 | |
528 | 528 | // Disable location based search for disabled location post type. |
529 | 529 | if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') { |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | } |
538 | 538 | } |
539 | 539 | |
540 | - if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text;?>')) { |
|
540 | + if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text; ?>')) { |
|
541 | 541 | geodir_setsearch($form); |
542 | 542 | } else { |
543 | 543 | jQuery(".snear", $form).val(''); |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | }); |
558 | 558 | |
559 | 559 | function geodir_setsearch($form) { |
560 | - if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text;?>')) jQuery(".snear", $form).val(default_location); |
|
560 | + if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text; ?>')) jQuery(".snear", $form).val(default_location); |
|
561 | 561 | geocodeAddress($form); |
562 | 562 | } |
563 | 563 | |
@@ -570,8 +570,8 @@ discard block |
||
570 | 570 | function geocodeAddress($form) { |
571 | 571 | Sgeocoder = new google.maps.Geocoder(); // Call the geocode function |
572 | 572 | |
573 | - if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != '' ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) { |
|
574 | - if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) { |
|
573 | + if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != '' ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) { |
|
574 | + if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) { |
|
575 | 575 | jQuery(".snear", $form).val(''); |
576 | 576 | } |
577 | 577 | jQuery($form).submit(); |
@@ -579,24 +579,24 @@ discard block |
||
579 | 579 | |
580 | 580 | var address = jQuery(".snear", $form).val(); |
581 | 581 | |
582 | - if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') { |
|
582 | + if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') { |
|
583 | 583 | initialise2(); |
584 | 584 | } else { |
585 | 585 | |
586 | 586 | Sgeocoder.geocode({'address': address<?php |
587 | - if($near_add = get_option('geodir_search_near_addition')){echo '+", '.$near_add.'"';} |
|
588 | - if($near_add2 = |
|
587 | + if ($near_add = get_option('geodir_search_near_addition')) {echo '+", ' . $near_add . '"'; } |
|
588 | + if ($near_add2 = |
|
589 | 589 | /** |
590 | 590 | * Adds any extra info to the near search box query when trying to geolocate it via google api. |
591 | 591 | * |
592 | 592 | * @since 1.0.0 |
593 | 593 | */ |
594 | - apply_filters('geodir_search_near_addition','')){echo $near_add2;}//gt_advanced_near_search();?>}, |
|
594 | + apply_filters('geodir_search_near_addition', '')) {echo $near_add2; }//gt_advanced_near_search();?>}, |
|
595 | 595 | function (results, status) { |
596 | 596 | if (status == google.maps.GeocoderStatus.OK) { |
597 | 597 | updateSearchPosition(results[0].geometry.location, $form); |
598 | 598 | } else { |
599 | - alert("<?php _e('Search was not successful for the following reason:','geodirectory');?>" + status); |
|
599 | + alert("<?php _e('Search was not successful for the following reason:', 'geodirectory'); ?>" + status); |
|
600 | 600 | } |
601 | 601 | }); |
602 | 602 | } |
@@ -627,19 +627,19 @@ discard block |
||
627 | 627 | var msg; |
628 | 628 | switch (err.code) { |
629 | 629 | case err.UNKNOWN_ERROR: |
630 | - msg = "<?php _e('Unable to find your location','geodirectory');?>"; |
|
630 | + msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>"; |
|
631 | 631 | break; |
632 | 632 | case err.PERMISSION_DENINED: |
633 | - msg = "<?php _e('Permission denied in finding your location','geodirectory');?>"; |
|
633 | + msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>"; |
|
634 | 634 | break; |
635 | 635 | case err.POSITION_UNAVAILABLE: |
636 | - msg = "<?php _e('Your location is currently unknown','geodirectory');?>"; |
|
636 | + msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>"; |
|
637 | 637 | break; |
638 | 638 | case err.BREAK: |
639 | - msg = "<?php _e('Attempt to find location took too long','geodirectory');?>"; |
|
639 | + msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>"; |
|
640 | 640 | break; |
641 | 641 | default: |
642 | - msg = "<?php _e('Location detection not supported in browser','geodirectory');?>"; |
|
642 | + msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>"; |
|
643 | 643 | } |
644 | 644 | jQuery('#info').html(msg); |
645 | 645 | } |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | * @param object $post The post object. |
680 | 680 | * @param string $link The link to the post. |
681 | 681 | */ |
682 | - return apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img"> </span></a>',$post,$link); |
|
682 | + return apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img"> </span></a>', $post, $link); |
|
683 | 683 | break; |
684 | 684 | case 'new' : |
685 | 685 | /** |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | * @param object $post The post object. |
690 | 690 | * @param string $link The link to the post. |
691 | 691 | */ |
692 | - return apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing"> </span></a>',$post,$link); |
|
692 | + return apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing"> </span></a>', $post, $link); |
|
693 | 693 | break; |
694 | 694 | |
695 | 695 | } |
@@ -1083,7 +1083,7 @@ |
||
1083 | 1083 | * @package GeoDirectory |
1084 | 1084 | */ |
1085 | 1085 | include_once('geodirectory-widgets/geodirectory_bestof_widget.php'); |
1086 | - /** |
|
1086 | + /** |
|
1087 | 1087 | * Contains all functions for cpt categories widget. |
1088 | 1088 | * |
1089 | 1089 | * @since 1.5.4 |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | public function form($instance) |
302 | 302 | { |
303 | 303 | //widgetform in backend |
304 | - $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => '')); |
|
304 | + $instance = wp_parse_args((array) $instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => '')); |
|
305 | 305 | $title = strip_tags($instance['title']); |
306 | 306 | |
307 | 307 | ?> |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | ?> |
374 | 374 | |
375 | 375 | <a href="http://twitter.com/share" |
376 | - class="twitter-share-button"><?php _e('Tweet', 'geodirectory');?></a> |
|
376 | + class="twitter-share-button"><?php _e('Tweet', 'geodirectory'); ?></a> |
|
377 | 377 | |
378 | 378 | <script type="text/javascript" src="//platform.twitter.com/widgets.js"></script> |
379 | 379 | |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | public function form($instance) |
444 | 444 | { |
445 | 445 | //widgetform in backend |
446 | - $instance = wp_parse_args((array)$instance, array('title' => '')); |
|
446 | + $instance = wp_parse_args((array) $instance, array('title' => '')); |
|
447 | 447 | $title = strip_tags($instance['title']); |
448 | 448 | ?> |
449 | 449 | <p>No settings for this widget</p> |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | echo 'http://feeds2.feedburner.com/' . $id; |
520 | 520 | } else { |
521 | 521 | bloginfo('rss_url'); |
522 | - } ?>"><i class="fa fa-rss-square"></i> </a><?php echo $after_title;?> |
|
522 | + } ?>"><i class="fa fa-rss-square"></i> </a><?php echo $after_title; ?> |
|
523 | 523 | |
524 | 524 | <?php if ($text <> "") { ?> |
525 | 525 | |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | public function form($instance) |
585 | 585 | { |
586 | 586 | //widgetform in backend |
587 | - $instance = wp_parse_args((array)$instance, array('title' => '', 'id' => '', 'advt1' => '', 'text' => '', 'twitter' => '', 'facebook' => '', 'digg' => '', 'myspace' => '')); |
|
587 | + $instance = wp_parse_args((array) $instance, array('title' => '', 'id' => '', 'advt1' => '', 'text' => '', 'twitter' => '', 'facebook' => '', 'digg' => '', 'myspace' => '')); |
|
588 | 588 | |
589 | 589 | $id = strip_tags($instance['id']); |
590 | 590 | |
@@ -596,19 +596,19 @@ discard block |
||
596 | 596 | |
597 | 597 | ?> |
598 | 598 | <p><label |
599 | - for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', 'geodirectory');?>: |
|
599 | + for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', 'geodirectory'); ?>: |
|
600 | 600 | <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" |
601 | 601 | name="<?php echo $this->get_field_name('title'); ?>" type="text" |
602 | 602 | value="<?php echo esc_attr($title); ?>"/></label></p> |
603 | 603 | |
604 | 604 | <p><label |
605 | - for="<?php echo $this->get_field_id('id'); ?>"><?php _e('Feedburner ID (ex :- geotheme)', 'geodirectory');?> |
|
605 | + for="<?php echo $this->get_field_id('id'); ?>"><?php _e('Feedburner ID (ex :- geotheme)', 'geodirectory'); ?> |
|
606 | 606 | : <input class="widefat" id="<?php echo $this->get_field_id('id'); ?>" |
607 | 607 | name="<?php echo $this->get_field_name('id'); ?>" type="text" |
608 | 608 | value="<?php echo esc_attr($id); ?>"/></label></p> |
609 | 609 | |
610 | 610 | <p><label |
611 | - for="<?php echo $this->get_field_id('text'); ?>"><?php _e('Short Description', 'geodirectory');?> |
|
611 | + for="<?php echo $this->get_field_id('text'); ?>"><?php _e('Short Description', 'geodirectory'); ?> |
|
612 | 612 | <textarea class="widefat" rows="6" cols="20" id="<?php echo $this->get_field_id('text'); ?>" |
613 | 613 | name="<?php echo $this->get_field_name('text'); ?>"><?php echo esc_attr($text); ?></textarea></label> |
614 | 614 | </p> |
@@ -704,12 +704,12 @@ discard block |
||
704 | 704 | public function form($instance) |
705 | 705 | { |
706 | 706 | //widgetform in backend |
707 | - $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => '')); |
|
707 | + $instance = wp_parse_args((array) $instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => '')); |
|
708 | 708 | |
709 | 709 | $desc1 = ($instance['desc1']); |
710 | 710 | ?> |
711 | 711 | <p><label |
712 | - for="<?php echo $this->get_field_id('desc1'); ?>"><?php _e('Your Advt code (ex.google adsense, etc.)', 'geodirectory');?> |
|
712 | + for="<?php echo $this->get_field_id('desc1'); ?>"><?php _e('Your Advt code (ex.google adsense, etc.)', 'geodirectory'); ?> |
|
713 | 713 | <textarea class="widefat" rows="6" cols="20" id="<?php echo $this->get_field_id('desc1'); ?>" |
714 | 714 | name="<?php echo $this->get_field_name('desc1'); ?>"><?php echo esc_attr($desc1); ?></textarea></label> |
715 | 715 | </p> |
@@ -819,14 +819,14 @@ discard block |
||
819 | 819 | { |
820 | 820 | |
821 | 821 | //widgetform in backend |
822 | - $instance = wp_parse_args((array)$instance, array('title' => '', 'id' => '', 'number' => '')); |
|
822 | + $instance = wp_parse_args((array) $instance, array('title' => '', 'id' => '', 'number' => '')); |
|
823 | 823 | $id = strip_tags($instance['id']); |
824 | 824 | $number = strip_tags($instance['number']); |
825 | 825 | ?> |
826 | 826 | |
827 | 827 | <p> |
828 | 828 | <label |
829 | - for="<?php echo $this->get_field_id('id'); ?>"><?php _e('Flickr ID', 'geodirectory');?> |
|
829 | + for="<?php echo $this->get_field_id('id'); ?>"><?php _e('Flickr ID', 'geodirectory'); ?> |
|
830 | 830 | (<a href="http://www.idgettr.com">idGettr</a>): |
831 | 831 | <input class="widefat" id="<?php echo $this->get_field_id('id'); ?>" |
832 | 832 | name="<?php echo $this->get_field_name('id'); ?>" type="text" |
@@ -836,7 +836,7 @@ discard block |
||
836 | 836 | |
837 | 837 | <p> |
838 | 838 | <label |
839 | - for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of photos:', 'geodirectory');?> |
|
839 | + for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of photos:', 'geodirectory'); ?> |
|
840 | 840 | <input class="widefat" id="<?php echo $this->get_field_id('number'); ?>" |
841 | 841 | name="<?php echo $this->get_field_name('number'); ?>" type="text" |
842 | 842 | value="<?php echo esc_attr($number); ?>"/> |
@@ -932,12 +932,12 @@ discard block |
||
932 | 932 | public function form($instance) |
933 | 933 | { |
934 | 934 | //widgetform in backend |
935 | - $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'gd_tw_desc1' => '')); |
|
935 | + $instance = wp_parse_args((array) $instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'gd_tw_desc1' => '')); |
|
936 | 936 | |
937 | 937 | $desc1 = ($instance['gd_tw_desc1']); |
938 | 938 | ?> |
939 | 939 | <p><label |
940 | - for="<?php echo $this->get_field_id('gd_tw_desc1'); ?>"><?php _e('Your twitter code', 'geodirectory');?> |
|
940 | + for="<?php echo $this->get_field_id('gd_tw_desc1'); ?>"><?php _e('Your twitter code', 'geodirectory'); ?> |
|
941 | 941 | <textarea class="widefat" rows="6" cols="20" |
942 | 942 | id="<?php echo $this->get_field_id('gd_tw_desc1'); ?>" |
943 | 943 | name="<?php echo $this->get_field_name('gd_tw_desc1'); ?>"><?php echo esc_attr($desc1); ?></textarea></label> |