Test Failed
Push — master ( dcaaa3...501953 )
by
unknown
04:26
created
geodirectory-admin/option-pages/permalink_settings_array.php 1 patch
Indentation   +178 added lines, -178 removed lines patch added patch discarded remove patch
@@ -16,184 +16,184 @@
 block discarded – undo
16 16
  */
17 17
 $geodir_settings['permalink_settings'] = apply_filters('geodir_permalink_settings', array(
18 18
 
19
-    /* Listing Permalink Settings start */
20
-    array('name' => __('Permalink', 'geodirectory'), 'type' => 'no_tabs', 'desc' => 'Settings to set permalink', 'id' => 'geodir_permalink_settings '),
21
-
22
-
23
-    array('name' => __('Listing Detail Permalink Settings', 'geodirectory'),
24
-        'type' => 'sectionstart',
25
-        'desc' => '',
26
-        'id' => 'geodir_permalink'),
27
-
28
-    array(
29
-        'name' => __('Add location in urls', 'geodirectory'),
30
-        'desc' => __('Add location slug in listing urls', 'geodirectory'),
31
-        'id' => 'geodir_add_location_url',
32
-        'type' => 'checkbox',
33
-        'std' => '1',
34
-        'checkboxgroup' => 'start'
35
-    ),
36
-
37
-    array(
38
-        'name' => __('Add full location in listing urls', 'geodirectory'),
39
-        'desc' => __('Add full location info with country, region and city slug in listing urls', 'geodirectory'),
40
-        'id' => 'geodir_show_location_url',
41
-        'type' => 'radio',
42
-        'value' => 'all',
43
-        'std' => 'all',
44
-        'radiogroup' => ''
45
-    ),
46
-
47
-	array(
48
-        'name' => __('Add country and city slug in listing urls', 'geodirectory'),
49
-        'desc' => __('Add country and city slug in listing urls (/country/city/)', 'geodirectory'),
50
-        'id' => 'geodir_show_location_url',
51
-        'type' => 'radio',
52
-        'std' => 'all',
53
-        'value' => 'country_city',
54
-        'radiogroup' => ''
55
-    ),
56
-	array(
57
-        'name' => __('Add region and city slug in listing urls', 'geodirectory'),
58
-        'desc' => __('Add region and city slug in listing urls (/region/city/)', 'geodirectory'),
59
-        'id' => 'geodir_show_location_url',
60
-        'type' => 'radio',
61
-        'std' => 'all',
62
-        'value' => 'region_city',
63
-        'radiogroup' => ''
64
-    ),
65
-    array(
66
-        'name' => __('Add only city in listing urls', 'geodirectory'),
67
-        'desc' => __('Add city slug in listing urls', 'geodirectory'),
68
-        'id' => 'geodir_show_location_url',
69
-        'type' => 'radio',
70
-        'std' => 'all',
71
-        'value' => 'city',
72
-        'radiogroup' => 'end'
73
-    ),
74
-
75
-
76
-
77
-    array(
78
-        'name' => __('Add category in listing urls', 'geodirectory'),
79
-        'desc' => __('Add requested category slugs in listing urls', 'geodirectory'),
80
-        'id' => 'geodir_add_categories_url',
81
-        'type' => 'checkbox',
82
-        'std' => '1',
83
-    ),
84
-
85
-    array(
86
-        'name' => __('Listing url prefix', 'geodirectory'),
87
-        'desc' => __('Listing prefix to show in url', 'geodirectory'),
88
-        'id' => 'geodir_listing_prefix',
89
-        'type' => 'text',
90
-        'css' => 'min-width:300px;',
91
-        'std' => 'places'
92
-    ),
93
-
94
-    array(
95
-        'name' => __('Location url prefix', 'geodirectory'),
96
-        'desc' => __('Depreciated, now uses the location page slug', 'geodirectory'),
97
-        'id' => 'geodir_location_prefix',
98
-        'type' => 'text',
99
-        'css' => 'min-width:300px;',
100
-        'std' => 'location' // Default value to show home top section
101
-    ),
102
-
103
-    array(
104
-        'name' => __('Location and category url separator', 'geodirectory'),
105
-        'desc' => __('Separator to show between location and category url slugs in listing urls', 'geodirectory'),
106
-        'id' => 'geodir_listingurl_separator',
107
-        'type' => 'text',
108
-        'css' => 'min-width:300px;',
109
-        'std' => 'C' // Default value to show home top section
110
-    ),
111
-
112
-    array(
113
-        'name' => __('Listing detail url separator', 'geodirectory'),
114
-        'desc' => __('Separator to show before listing slug in listing detail urls', 'geodirectory'),
115
-        'id' => 'geodir_detailurl_separator',
116
-        'type' => 'text',
117
-        'css' => 'min-width:300px;',
118
-        'std' => 'info' // Default value to show home top section
119
-    ),
120
-
121
-
122
-    array('type' => 'sectionend', 'id' => 'geodir_permalink'),
123
-
124
-    array('name' => __('GeoDirectory Pages', 'geodirectory'),
125
-        'type' => 'sectionstart',
126
-        'desc' => '',
127
-        'id' => 'geodir_pages'),
128
-
129
-    array(
130
-        'name' => __('GD Home page', 'geodirectory'),
131
-        'desc' => __('Select the page to use for the GD homepage (you must also set this page in Settings>Reading>Front page for it to work)', 'geodirectory'),
132
-        'id' => 'geodir_home_page',
133
-        'type' => 'single_select_page',
134
-        'class' => 'chosen_select'
135
-    ),
136
-
137
-    array(
138
-        'name' => __('Add listing page', 'geodirectory'),
139
-        'desc' => __('Select the page to use for adding listings', 'geodirectory'),
140
-        'id' => 'geodir_add_listing_page',
141
-        'type' => 'single_select_page',
142
-        'class' => 'chosen_select'
143
-    ),
144
-
145
-    array(
146
-        'name' => __('Listing preview page', 'geodirectory'),
147
-        'desc' => __('Select the page to use for listing preview', 'geodirectory'),
148
-        'id' => 'geodir_preview_page',
149
-        'type' => 'single_select_page',
150
-        'class' => 'chosen_select'
151
-    ),
152
-
153
-    array(
154
-        'name' => __('Listing success page', 'geodirectory'),
155
-        'desc' => __('Select the page to use for listing success', 'geodirectory'),
156
-        'id' => 'geodir_success_page',
157
-        'type' => 'single_select_page',
158
-        'class' => 'chosen_select'
159
-    ),
160
-
161
-    array(
162
-        'name' => __('Location page', 'geodirectory'),
163
-        'desc' => __('Select the page to use for locations', 'geodirectory'),
164
-        'id' => 'geodir_location_page',
165
-        'type' => 'single_select_page',
166
-        'class' => 'chosen_select'
167
-    ),
168
-
169
-    array(
170
-        'name' => __('Terms and Conditions page', 'geodirectory'),
171
-        'desc' => __('Select the page to use for Terms and Conditions (if enabled)', 'geodirectory'),
172
-        'id' => 'geodir_term_condition_page',
173
-        'type' => 'single_select_page',
174
-        'class' => 'chosen_select'
175
-    ),
176
-
177
-    array(
178
-        'name' => __('Info page', 'geodirectory'),
179
-        'desc' => __('Select the page to use for Gd general Info', 'geodirectory'),
180
-        'id' => 'geodir_info_page',
181
-        'type' => 'single_select_page',
182
-        'class' => 'chosen_select'
183
-    ),
184
-
185
-    array(
186
-        'name' => __('Login page', 'geodirectory'),
187
-        'desc' => __('Select the page to use for Login / Register', 'geodirectory'),
188
-        'id' => 'geodir_login_page',
189
-        'type' => 'single_select_page',
190
-        'class' => 'chosen_select'
191
-    ),
192
-
193
-
194
-    array('type' => 'sectionend', 'id' => 'geodir_pages'),
195
-
196
-    /* Listing Detail Permalink Settings End */
19
+	/* Listing Permalink Settings start */
20
+	array('name' => __('Permalink', 'geodirectory'), 'type' => 'no_tabs', 'desc' => 'Settings to set permalink', 'id' => 'geodir_permalink_settings '),
21
+
22
+
23
+	array('name' => __('Listing Detail Permalink Settings', 'geodirectory'),
24
+		'type' => 'sectionstart',
25
+		'desc' => '',
26
+		'id' => 'geodir_permalink'),
27
+
28
+	array(
29
+		'name' => __('Add location in urls', 'geodirectory'),
30
+		'desc' => __('Add location slug in listing urls', 'geodirectory'),
31
+		'id' => 'geodir_add_location_url',
32
+		'type' => 'checkbox',
33
+		'std' => '1',
34
+		'checkboxgroup' => 'start'
35
+	),
36
+
37
+	array(
38
+		'name' => __('Add full location in listing urls', 'geodirectory'),
39
+		'desc' => __('Add full location info with country, region and city slug in listing urls', 'geodirectory'),
40
+		'id' => 'geodir_show_location_url',
41
+		'type' => 'radio',
42
+		'value' => 'all',
43
+		'std' => 'all',
44
+		'radiogroup' => ''
45
+	),
46
+
47
+	array(
48
+		'name' => __('Add country and city slug in listing urls', 'geodirectory'),
49
+		'desc' => __('Add country and city slug in listing urls (/country/city/)', 'geodirectory'),
50
+		'id' => 'geodir_show_location_url',
51
+		'type' => 'radio',
52
+		'std' => 'all',
53
+		'value' => 'country_city',
54
+		'radiogroup' => ''
55
+	),
56
+	array(
57
+		'name' => __('Add region and city slug in listing urls', 'geodirectory'),
58
+		'desc' => __('Add region and city slug in listing urls (/region/city/)', 'geodirectory'),
59
+		'id' => 'geodir_show_location_url',
60
+		'type' => 'radio',
61
+		'std' => 'all',
62
+		'value' => 'region_city',
63
+		'radiogroup' => ''
64
+	),
65
+	array(
66
+		'name' => __('Add only city in listing urls', 'geodirectory'),
67
+		'desc' => __('Add city slug in listing urls', 'geodirectory'),
68
+		'id' => 'geodir_show_location_url',
69
+		'type' => 'radio',
70
+		'std' => 'all',
71
+		'value' => 'city',
72
+		'radiogroup' => 'end'
73
+	),
74
+
75
+
76
+
77
+	array(
78
+		'name' => __('Add category in listing urls', 'geodirectory'),
79
+		'desc' => __('Add requested category slugs in listing urls', 'geodirectory'),
80
+		'id' => 'geodir_add_categories_url',
81
+		'type' => 'checkbox',
82
+		'std' => '1',
83
+	),
84
+
85
+	array(
86
+		'name' => __('Listing url prefix', 'geodirectory'),
87
+		'desc' => __('Listing prefix to show in url', 'geodirectory'),
88
+		'id' => 'geodir_listing_prefix',
89
+		'type' => 'text',
90
+		'css' => 'min-width:300px;',
91
+		'std' => 'places'
92
+	),
93
+
94
+	array(
95
+		'name' => __('Location url prefix', 'geodirectory'),
96
+		'desc' => __('Depreciated, now uses the location page slug', 'geodirectory'),
97
+		'id' => 'geodir_location_prefix',
98
+		'type' => 'text',
99
+		'css' => 'min-width:300px;',
100
+		'std' => 'location' // Default value to show home top section
101
+	),
102
+
103
+	array(
104
+		'name' => __('Location and category url separator', 'geodirectory'),
105
+		'desc' => __('Separator to show between location and category url slugs in listing urls', 'geodirectory'),
106
+		'id' => 'geodir_listingurl_separator',
107
+		'type' => 'text',
108
+		'css' => 'min-width:300px;',
109
+		'std' => 'C' // Default value to show home top section
110
+	),
111
+
112
+	array(
113
+		'name' => __('Listing detail url separator', 'geodirectory'),
114
+		'desc' => __('Separator to show before listing slug in listing detail urls', 'geodirectory'),
115
+		'id' => 'geodir_detailurl_separator',
116
+		'type' => 'text',
117
+		'css' => 'min-width:300px;',
118
+		'std' => 'info' // Default value to show home top section
119
+	),
120
+
121
+
122
+	array('type' => 'sectionend', 'id' => 'geodir_permalink'),
123
+
124
+	array('name' => __('GeoDirectory Pages', 'geodirectory'),
125
+		'type' => 'sectionstart',
126
+		'desc' => '',
127
+		'id' => 'geodir_pages'),
128
+
129
+	array(
130
+		'name' => __('GD Home page', 'geodirectory'),
131
+		'desc' => __('Select the page to use for the GD homepage (you must also set this page in Settings>Reading>Front page for it to work)', 'geodirectory'),
132
+		'id' => 'geodir_home_page',
133
+		'type' => 'single_select_page',
134
+		'class' => 'chosen_select'
135
+	),
136
+
137
+	array(
138
+		'name' => __('Add listing page', 'geodirectory'),
139
+		'desc' => __('Select the page to use for adding listings', 'geodirectory'),
140
+		'id' => 'geodir_add_listing_page',
141
+		'type' => 'single_select_page',
142
+		'class' => 'chosen_select'
143
+	),
144
+
145
+	array(
146
+		'name' => __('Listing preview page', 'geodirectory'),
147
+		'desc' => __('Select the page to use for listing preview', 'geodirectory'),
148
+		'id' => 'geodir_preview_page',
149
+		'type' => 'single_select_page',
150
+		'class' => 'chosen_select'
151
+	),
152
+
153
+	array(
154
+		'name' => __('Listing success page', 'geodirectory'),
155
+		'desc' => __('Select the page to use for listing success', 'geodirectory'),
156
+		'id' => 'geodir_success_page',
157
+		'type' => 'single_select_page',
158
+		'class' => 'chosen_select'
159
+	),
160
+
161
+	array(
162
+		'name' => __('Location page', 'geodirectory'),
163
+		'desc' => __('Select the page to use for locations', 'geodirectory'),
164
+		'id' => 'geodir_location_page',
165
+		'type' => 'single_select_page',
166
+		'class' => 'chosen_select'
167
+	),
168
+
169
+	array(
170
+		'name' => __('Terms and Conditions page', 'geodirectory'),
171
+		'desc' => __('Select the page to use for Terms and Conditions (if enabled)', 'geodirectory'),
172
+		'id' => 'geodir_term_condition_page',
173
+		'type' => 'single_select_page',
174
+		'class' => 'chosen_select'
175
+	),
176
+
177
+	array(
178
+		'name' => __('Info page', 'geodirectory'),
179
+		'desc' => __('Select the page to use for Gd general Info', 'geodirectory'),
180
+		'id' => 'geodir_info_page',
181
+		'type' => 'single_select_page',
182
+		'class' => 'chosen_select'
183
+	),
184
+
185
+	array(
186
+		'name' => __('Login page', 'geodirectory'),
187
+		'desc' => __('Select the page to use for Login / Register', 'geodirectory'),
188
+		'id' => 'geodir_login_page',
189
+		'type' => 'single_select_page',
190
+		'class' => 'chosen_select'
191
+	),
192
+
193
+
194
+	array('type' => 'sectionend', 'id' => 'geodir_pages'),
195
+
196
+	/* Listing Detail Permalink Settings End */
197 197
 
198 198
 
199 199
 )); // End Design settings
Please login to merge, or discard this patch.
geodirectory-functions/compatibility/Divi.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -18,11 +18,11 @@  discard block
 block discarded – undo
18 18
  */
19 19
 function geodir_divi_signup_body_class($classes)
20 20
 {
21
-    if (geodir_is_page('login')) {
22
-        $classes = str_replace('et_right_sidebar', 'et_full_width_page', $classes);
23
-        $classes[] = 'divi-gd-signup';
24
-    }
25
-    return $classes;
21
+	if (geodir_is_page('login')) {
22
+		$classes = str_replace('et_right_sidebar', 'et_full_width_page', $classes);
23
+		$classes[] = 'divi-gd-signup';
24
+	}
25
+	return $classes;
26 26
 }
27 27
 
28 28
 add_action('geodir_wrapper_close', 'geodir_divi_action_wrapper_close', 11);
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
  */
35 35
 function geodir_divi_action_wrapper_close()
36 36
 {
37
-    if (geodir_is_page('login')) {
38
-        // We need to close extra divs generated by WRAPPER BEFORE MAIN CONTENT (below) because there is no sidebar on this page
39
-        echo '</div></div>';
40
-    }
37
+	if (geodir_is_page('login')) {
38
+		// We need to close extra divs generated by WRAPPER BEFORE MAIN CONTENT (below) because there is no sidebar on this page
39
+		echo '</div></div>';
40
+	}
41 41
 }
42 42
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-functions/compatibility/Multi_News.php 3 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -126,8 +126,10 @@
 block discarded – undo
126 126
     $regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>";
127 127
     if (preg_match_all("/$regexp/siU", $crums, $matches)) {
128 128
         return $matches[0];
129
-    } else return '';
130
-}
129
+    } else {
130
+    	return '';
131
+    }
132
+    }
131 133
 
132 134
 
133 135
 /**
Please login to merge, or discard this patch.
Indentation   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -16,36 +16,36 @@  discard block
 block discarded – undo
16 16
  */
17 17
 function multi_news_action_calls()
18 18
 {
19
-    // REMOVE BREADCRUMB
20
-    remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20);
21
-    remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20);
22
-    remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20);
23
-    remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20);
24
-    remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20);
25
-    remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20);
26
-
27
-    //ADD BREADCRUMS
28
-    add_action('geodir_detail_before_main_content', 'gd_mn_replace_breadcrums', 20);
29
-    add_action('geodir_listings_before_main_content', 'gd_mn_replace_breadcrums', 20);
30
-    add_action('geodir_author_before_main_content', 'gd_mn_replace_breadcrums', 20);
31
-    add_action('geodir_search_before_main_content', 'gd_mn_replace_breadcrums', 20);
32
-    //add_action('geodir_home_before_main_content', 'gd_mn_replace_breadcrums', 20);
33
-    add_action('geodir_location_before_main_content', 'gd_mn_replace_breadcrums', 20);
34
-
35
-
36
-    // fix breadcrums
37
-    add_filter('breadcrumbs_plus_items', 'gd_breadcrumbs_plus_items', 1);
38
-
39
-    // REMOVE PAGE TITLES
40
-    remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10);
41
-    // remove_action( 'geodir_add_listing_page_title', 'geodir_action_add_listing_page_title',10);
42
-    remove_action('geodir_details_main_content', 'geodir_action_page_title', 20);
43
-    remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10);
44
-    remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10);
45
-
46
-
47
-    add_action('geodir_wrapper_content_open', 'gd_mn_extra_wrap', 30, 1);
48
-    add_action('geodir_wrapper_content_close', 'gd_mn_extra_wrap_end', 3, 1);
19
+	// REMOVE BREADCRUMB
20
+	remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20);
21
+	remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20);
22
+	remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20);
23
+	remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20);
24
+	remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20);
25
+	remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20);
26
+
27
+	//ADD BREADCRUMS
28
+	add_action('geodir_detail_before_main_content', 'gd_mn_replace_breadcrums', 20);
29
+	add_action('geodir_listings_before_main_content', 'gd_mn_replace_breadcrums', 20);
30
+	add_action('geodir_author_before_main_content', 'gd_mn_replace_breadcrums', 20);
31
+	add_action('geodir_search_before_main_content', 'gd_mn_replace_breadcrums', 20);
32
+	//add_action('geodir_home_before_main_content', 'gd_mn_replace_breadcrums', 20);
33
+	add_action('geodir_location_before_main_content', 'gd_mn_replace_breadcrums', 20);
34
+
35
+
36
+	// fix breadcrums
37
+	add_filter('breadcrumbs_plus_items', 'gd_breadcrumbs_plus_items', 1);
38
+
39
+	// REMOVE PAGE TITLES
40
+	remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10);
41
+	// remove_action( 'geodir_add_listing_page_title', 'geodir_action_add_listing_page_title',10);
42
+	remove_action('geodir_details_main_content', 'geodir_action_page_title', 20);
43
+	remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10);
44
+	remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10);
45
+
46
+
47
+	add_action('geodir_wrapper_content_open', 'gd_mn_extra_wrap', 30, 1);
48
+	add_action('geodir_wrapper_content_close', 'gd_mn_extra_wrap_end', 3, 1);
49 49
 }
50 50
 
51 51
 /**
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
  */
58 58
 function gd_mn_extra_wrap($page)
59 59
 {
60
-    if ($page == 'add-listing-page') {
61
-        echo '<div class="site-content page-wrap">';
62
-    } elseif ($page == 'signup-page') {
63
-        echo '</div><div class="section full-width-section" style="float: left;width:100%;">';
64
-    }
60
+	if ($page == 'add-listing-page') {
61
+		echo '<div class="site-content page-wrap">';
62
+	} elseif ($page == 'signup-page') {
63
+		echo '</div><div class="section full-width-section" style="float: left;width:100%;">';
64
+	}
65 65
 
66 66
 }
67 67
 
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
  */
76 76
 function gd_mn_extra_wrap_end($page)
77 77
 {
78
-    if ($page == 'add-listing-page') {
79
-        echo '</div>';
80
-    }
78
+	if ($page == 'add-listing-page') {
79
+		echo '</div>';
80
+	}
81 81
 
82 82
 }
83 83
 
@@ -91,13 +91,13 @@  discard block
 block discarded – undo
91 91
 function gd_mn_replace_breadcrums()
92 92
 {
93 93
 
94
-    if (mom_option('breadcrumb') != 0) { ?>
94
+	if (mom_option('breadcrumb') != 0) { ?>
95 95
         <?php if (mom_option('cats_bread')) {
96
-            $cclass = '';
97
-            if (mom_option('cat_slider') == false) {
98
-                $cclass = 'post-crumbs ';
99
-            }
100
-            ?>
96
+			$cclass = '';
97
+			if (mom_option('cat_slider') == false) {
98
+				$cclass = 'post-crumbs ';
99
+			}
100
+			?>
101 101
             <div class="<?php echo $cclass; ?>entry-crumbs" xmlns:v="http://rdf.data-vocabulary.org/#">
102 102
 
103 103
                 <?php mom_breadcrumb(); ?>
@@ -119,14 +119,14 @@  discard block
 block discarded – undo
119 119
  */
120 120
 function gd_get_breadcrum_links()
121 121
 {
122
-    ob_start();
123
-    geodir_breadcrumb();
124
-    $crums = ob_get_contents();
125
-    ob_get_clean();
126
-    $regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>";
127
-    if (preg_match_all("/$regexp/siU", $crums, $matches)) {
128
-        return $matches[0];
129
-    } else return '';
122
+	ob_start();
123
+	geodir_breadcrumb();
124
+	$crums = ob_get_contents();
125
+	ob_get_clean();
126
+	$regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>";
127
+	if (preg_match_all("/$regexp/siU", $crums, $matches)) {
128
+		return $matches[0];
129
+	} else return '';
130 130
 }
131 131
 
132 132
 
@@ -140,30 +140,30 @@  discard block
 block discarded – undo
140 140
  */
141 141
 function gd_breadcrumbs_plus_items($items)
142 142
 {   //print_r($items);exit;
143
-    $bits = array();
144
-    $pieces = gd_get_breadcrum_links();
145
-    //unset($pieces[0]);
146
-    $bits = $pieces;
143
+	$bits = array();
144
+	$pieces = gd_get_breadcrum_links();
145
+	//unset($pieces[0]);
146
+	$bits = $pieces;
147 147
 
148
-    $title = $items['last'];
149
-    if (is_page_geodir_home() || geodir_is_page('location')) {
148
+	$title = $items['last'];
149
+	if (is_page_geodir_home() || geodir_is_page('location')) {
150 150
 
151
-    } elseif (geodir_is_page('listing')) {
151
+	} elseif (geodir_is_page('listing')) {
152 152
 
153
-    } elseif (geodir_is_page('detail')) {
154
-        ob_start();
155
-        geodir_action_page_title();
156
-        $title = ob_get_contents();
157
-        ob_end_clean();
158
-    } elseif (geodir_is_page('search')) {
159
-    } elseif (geodir_is_page('author')) {
160
-    }
153
+	} elseif (geodir_is_page('detail')) {
154
+		ob_start();
155
+		geodir_action_page_title();
156
+		$title = ob_get_contents();
157
+		ob_end_clean();
158
+	} elseif (geodir_is_page('search')) {
159
+	} elseif (geodir_is_page('author')) {
160
+	}
161 161
 
162
-    $title = strip_tags($title);
163
-    $items = gd_breadcrumbs_plus_items_add($items, $bits, $title);
162
+	$title = strip_tags($title);
163
+	$items = gd_breadcrumbs_plus_items_add($items, $bits, $title);
164 164
 
165 165
 
166
-    return $items;
166
+	return $items;
167 167
 }
168 168
 
169 169
 
@@ -179,28 +179,28 @@  discard block
 block discarded – undo
179 179
  */
180 180
 function gd_breadcrumbs_plus_items_add($items, $bits, $last)
181 181
 {
182
-    //$pieces = explode("</div>", $items[0]);
183
-    if (is_array($bits)) {
184
-        $items = array();
185
-        $pieces = '';
186
-        foreach ($bits as $bit) {
187
-            $pieces .= $bit;
188
-        }
189
-        $items[0] = '<div class="vbreadcrumb" typeof="v:Breadcrumb">' . $pieces . "</div>";
190
-        if (isset($last) && $last) {
191
-            $items['last'] = $last;
192
-        }
193
-    }
194
-
195
-    //print_r($items);
196
-    return $items;
182
+	//$pieces = explode("</div>", $items[0]);
183
+	if (is_array($bits)) {
184
+		$items = array();
185
+		$pieces = '';
186
+		foreach ($bits as $bit) {
187
+			$pieces .= $bit;
188
+		}
189
+		$items[0] = '<div class="vbreadcrumb" typeof="v:Breadcrumb">' . $pieces . "</div>";
190
+		if (isset($last) && $last) {
191
+			$items['last'] = $last;
192
+		}
193
+	}
194
+
195
+	//print_r($items);
196
+	return $items;
197 197
 
198 198
 }
199 199
 
200 200
 add_filter('geodir_menu_after_sub_ul','gd_multinews_mobile_menu_caret',10,1);
201 201
 add_filter('geodir_location_switcher_menu_after_sub_ul','gd_multinews_mobile_menu_caret',10,1);
202 202
 function gd_multinews_mobile_menu_caret($html){
203
-    $html .= '<i class="responsive-caret"></i>';
204
-    return $html;
203
+	$html .= '<i class="responsive-caret"></i>';
204
+	return $html;
205 205
 
206 206
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
         foreach ($bits as $bit) {
187 187
             $pieces .= $bit;
188 188
         }
189
-        $items[0] = '<div class="vbreadcrumb" typeof="v:Breadcrumb">' . $pieces . "</div>";
189
+        $items[0] = '<div class="vbreadcrumb" typeof="v:Breadcrumb">'.$pieces."</div>";
190 190
         if (isset($last) && $last) {
191 191
             $items['last'] = $last;
192 192
         }
@@ -197,9 +197,9 @@  discard block
 block discarded – undo
197 197
 
198 198
 }
199 199
 
200
-add_filter('geodir_menu_after_sub_ul','gd_multinews_mobile_menu_caret',10,1);
201
-add_filter('geodir_location_switcher_menu_after_sub_ul','gd_multinews_mobile_menu_caret',10,1);
202
-function gd_multinews_mobile_menu_caret($html){
200
+add_filter('geodir_menu_after_sub_ul', 'gd_multinews_mobile_menu_caret', 10, 1);
201
+add_filter('geodir_location_switcher_menu_after_sub_ul', 'gd_multinews_mobile_menu_caret', 10, 1);
202
+function gd_multinews_mobile_menu_caret($html) {
203 203
     $html .= '<i class="responsive-caret"></i>';
204 204
     return $html;
205 205
 
Please login to merge, or discard this patch.
geodirectory-templates/geodir-signup.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@
 block discarded – undo
13 13
  * If user is not signed in, redirect home.
14 14
  */
15 15
 if (get_current_user_id()) {
16
-    wp_redirect(home_url(), 302);
17
-    exit;
16
+	wp_redirect(home_url(), 302);
17
+	exit;
18 18
 }
19 19
 
20 20
 // call header
Please login to merge, or discard this patch.
geodirectory-templates/preview-success.php 2 patches
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -15,29 +15,29 @@  discard block
 block discarded – undo
15 15
     <?php
16 16
 
17 17
 
18
-    global $wpdb;
18
+	global $wpdb;
19 19
 
20
-    $post_id = $_REQUEST['pid'];
21
-    $post_info = get_post($post_id);
20
+	$post_id = $_REQUEST['pid'];
21
+	$post_info = get_post($post_id);
22 22
 
23
-    $posted_date = $post_info->post_date;
24
-    $productlink = get_permalink($post_id);
25
-    $siteName = get_bloginfo('name');
26
-    $siteurl = home_url();
27
-    $siteurl_link = '<a href="' . $siteurl . '">' . $siteurl . '</a>';
23
+	$posted_date = $post_info->post_date;
24
+	$productlink = get_permalink($post_id);
25
+	$siteName = get_bloginfo('name');
26
+	$siteurl = home_url();
27
+	$siteurl_link = '<a href="' . $siteurl . '">' . $siteurl . '</a>';
28 28
 
29
-    $loginurl = geodir_login_url();
30
-    $loginurl_link = '<a href="' . $loginurl . '">login</a>';
29
+	$loginurl = geodir_login_url();
30
+	$loginurl_link = '<a href="' . $loginurl . '">login</a>';
31 31
 
32
-    $post_author = $post_info->post_author;
32
+	$post_author = $post_info->post_author;
33 33
 
34
-    $user_info = get_userdata($post_author);
35
-    $username = $user_info->user_login;
36
-    $user_email = $user_info->user_email;
34
+	$user_info = get_userdata($post_author);
35
+	$username = $user_info->user_login;
36
+	$user_email = $user_info->user_email;
37 37
 
38
-    $message = wpautop(__(stripslashes_deep(get_option('geodir_post_added_success_msg_content')),'geodirectory'));
38
+	$message = wpautop(__(stripslashes_deep(get_option('geodir_post_added_success_msg_content')),'geodirectory'));
39 39
 
40
-    /*
40
+	/*
41 41
      * Filter the success page message before variable replacements.
42 42
      *
43 43
      * @since 1.5.7
@@ -45,13 +45,13 @@  discard block
 block discarded – undo
45 45
      * @param object $post_info Post object.
46 46
      * @param object $user_info User object.
47 47
      */
48
-    $message = apply_filters('geodir_success_page_msg_before_var_replace', $message,$post_info, $user_info);
48
+	$message = apply_filters('geodir_success_page_msg_before_var_replace', $message,$post_info, $user_info);
49 49
 
50
-    $search_array = array('[#submited_information_link#]', '[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#user_email#]', '[#username#]', '[#login_url#]', '[#posted_date#]');
51
-    $replace_array = array($productlink, $productlink, $siteurl_link, $post_id, $siteName, $user_email, $username, $loginurl_link, $posted_date);
52
-    $message = str_replace($search_array, $replace_array, $message);
50
+	$search_array = array('[#submited_information_link#]', '[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#user_email#]', '[#username#]', '[#login_url#]', '[#posted_date#]');
51
+	$replace_array = array($productlink, $productlink, $siteurl_link, $post_id, $siteName, $user_email, $username, $loginurl_link, $posted_date);
52
+	$message = str_replace($search_array, $replace_array, $message);
53 53
 
54
-    /*
54
+	/*
55 55
      * Filter the success page message after variable replacements.
56 56
      *
57 57
      * @since 1.5.7
@@ -59,15 +59,15 @@  discard block
 block discarded – undo
59 59
      * @param object $post_info Post object.
60 60
      * @param object $user_info User object.
61 61
      */
62
-    $message = apply_filters('geodir_success_page_msg_after_var_replace', $message,$post_info, $user_info);
62
+	$message = apply_filters('geodir_success_page_msg_after_var_replace', $message,$post_info, $user_info);
63 63
 
64 64
 
65 65
 
66
-    ?>
66
+	?>
67 67
 
68 68
     <?php
69 69
 
70
-    /*
70
+	/*
71 71
      * Action called before the success page message wrapper.
72 72
      *
73 73
      * @since 1.5.7
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
      * @param object $post_info Post object.
76 76
      * @param object $user_info User object.
77 77
      */
78
-    do_action('geodir_before_success_page_msg_wrapper', $message,$post_info, $user_info);
79
-    echo '<h5 class="geodir_information">';
80
-    echo $message;
81
-    echo '</h5>';
82
-    /*
78
+	do_action('geodir_before_success_page_msg_wrapper', $message,$post_info, $user_info);
79
+	echo '<h5 class="geodir_information">';
80
+	echo $message;
81
+	echo '</h5>';
82
+	/*
83 83
      * Action called after the success page message wrapper.
84 84
      *
85 85
      * @since 1.5.7
@@ -87,8 +87,8 @@  discard block
 block discarded – undo
87 87
      * @param object $post_info Post object.
88 88
      * @param object $user_info User object.
89 89
      */
90
-    do_action('geodir_after_success_page_msg_wrapper', $message,$post_info, $user_info);
90
+	do_action('geodir_after_success_page_msg_wrapper', $message,$post_info, $user_info);
91 91
 
92
-    ?>
92
+	?>
93 93
 
94 94
 </div>
95 95
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -24,10 +24,10 @@  discard block
 block discarded – undo
24 24
     $productlink = get_permalink($post_id);
25 25
     $siteName = get_bloginfo('name');
26 26
     $siteurl = home_url();
27
-    $siteurl_link = '<a href="' . $siteurl . '">' . $siteurl . '</a>';
27
+    $siteurl_link = '<a href="'.$siteurl.'">'.$siteurl.'</a>';
28 28
 
29 29
     $loginurl = geodir_login_url();
30
-    $loginurl_link = '<a href="' . $loginurl . '">login</a>';
30
+    $loginurl_link = '<a href="'.$loginurl.'">login</a>';
31 31
 
32 32
     $post_author = $post_info->post_author;
33 33
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     $username = $user_info->user_login;
36 36
     $user_email = $user_info->user_email;
37 37
 
38
-    $message = wpautop(__(stripslashes_deep(get_option('geodir_post_added_success_msg_content')),'geodirectory'));
38
+    $message = wpautop(__(stripslashes_deep(get_option('geodir_post_added_success_msg_content')), 'geodirectory'));
39 39
 
40 40
     /*
41 41
      * Filter the success page message before variable replacements.
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      * @param object $post_info Post object.
46 46
      * @param object $user_info User object.
47 47
      */
48
-    $message = apply_filters('geodir_success_page_msg_before_var_replace', $message,$post_info, $user_info);
48
+    $message = apply_filters('geodir_success_page_msg_before_var_replace', $message, $post_info, $user_info);
49 49
 
50 50
     $search_array = array('[#submited_information_link#]', '[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#user_email#]', '[#username#]', '[#login_url#]', '[#posted_date#]');
51 51
     $replace_array = array($productlink, $productlink, $siteurl_link, $post_id, $siteName, $user_email, $username, $loginurl_link, $posted_date);
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      * @param object $post_info Post object.
60 60
      * @param object $user_info User object.
61 61
      */
62
-    $message = apply_filters('geodir_success_page_msg_after_var_replace', $message,$post_info, $user_info);
62
+    $message = apply_filters('geodir_success_page_msg_after_var_replace', $message, $post_info, $user_info);
63 63
 
64 64
 
65 65
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      * @param object $post_info Post object.
76 76
      * @param object $user_info User object.
77 77
      */
78
-    do_action('geodir_before_success_page_msg_wrapper', $message,$post_info, $user_info);
78
+    do_action('geodir_before_success_page_msg_wrapper', $message, $post_info, $user_info);
79 79
     echo '<h5 class="geodir_information">';
80 80
     echo $message;
81 81
     echo '</h5>';
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
      * @param object $post_info Post object.
88 88
      * @param object $user_info User object.
89 89
      */
90
-    do_action('geodir_after_success_page_msg_wrapper', $message,$post_info, $user_info);
90
+    do_action('geodir_after_success_page_msg_wrapper', $message, $post_info, $user_info);
91 91
 
92 92
     ?>
93 93
 
Please login to merge, or discard this patch.
geodirectory-widgets/geodirectory_popular_widget.php 3 patches
Braces   +37 added lines, -14 removed lines patch added patch discarded remove patch
@@ -190,10 +190,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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>
Please login to merge, or discard this patch.
Indentation   +204 added lines, -204 removed lines patch added patch discarded remove patch
@@ -14,83 +14,83 @@  discard block
 block discarded – undo
14 14
  */
15 15
 class geodir_popular_post_category extends WP_Widget
16 16
 {
17
-    /**
18
-     * Register the popular post category widget.
19
-     *
20
-     * @since 1.0.0
21
-     * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
22
-     */
23
-    public function __construct() {
24
-        $widget_ops = array('classname' => 'geodir_popular_post_category', 'description' => __('GD > Popular Post Category', 'geodirectory'));
25
-        parent::__construct(
26
-            'popular_post_category', // Base ID
27
-            __('GD > Popular Post Category', 'geodirectory'), // Name
28
-            $widget_ops// Args
29
-        );
30
-    }
31
-
32
-    /**
33
-     * Front-end display content for popular post category widget.
34
-     *
35
-     * @since 1.0.0
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)
42
-    {
43
-        geodir_popular_post_category_output($args, $instance);
44
-    }
45
-
46
-    /**
47
-     * Sanitize popular post category widget form values as they are saved.
48
-     *
49
-     * @since 1.0.0
50
-     * @since 1.5.1 Declare function public.
51
-     * @since 1.5.1 Added default_post_type parameter.
52
-     * @since 1.6.9 Added parent_only parameter.
53
-     *
54
-     * @param array $new_instance Values just sent to be saved.
55
-     * @param array $old_instance Previously saved values from database.
56
-     *
57
-     * @return array Updated safe values to be saved.
58
-     */ 
59
-    public function update($new_instance, $old_instance)
60
-    {
61
-        //save the widget
62
-        $instance = $old_instance;
63
-        $instance['title'] = strip_tags($new_instance['title']);
64
-        $category_limit = (int)$new_instance['category_limit'];
65
-        $instance['category_limit'] = $category_limit > 0 ? $category_limit : 15;
66
-        $instance['default_post_type'] = isset($new_instance['default_post_type']) ? $new_instance['default_post_type'] : '';
67
-        $instance['parent_only'] = !empty($new_instance['parent_only']) ? true : false;
68
-        return $instance;
69
-    }
70
-
71
-    /**
72
-     * Back-end popular post category widget settings form.
73
-     *
74
-     * @since 1.0.0
75
-     * @since 1.5.1 Declare function public.
76
-     * @since 1.5.1 Added option to set default post type.
77
-     * @since 1.6.9 Added option to show parent categories only.
78
-     *
79
-     * @param array $instance Previously saved values from database.
80
-     */
81
-    public function form($instance) 
82
-    {
83
-        //widgetform in backend
84
-        $instance = wp_parse_args((array)$instance, array('title' => '', 'category_limit' => 15, 'default_post_type' => '', 'parent_only' => false));
85
-
86
-        $title = strip_tags($instance['title']);
87
-        $category_limit = (int)$instance['category_limit'];
88
-        $category_limit = $category_limit > 0 ? $category_limit : 15;
89
-        $default_post_type = isset($instance['default_post_type']) ? $instance['default_post_type'] : '';
90
-        $parent_only = !empty($instance['parent_only']) ? true: false;
17
+	/**
18
+	 * Register the popular post category widget.
19
+	 *
20
+	 * @since 1.0.0
21
+	 * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
22
+	 */
23
+	public function __construct() {
24
+		$widget_ops = array('classname' => 'geodir_popular_post_category', 'description' => __('GD > Popular Post Category', 'geodirectory'));
25
+		parent::__construct(
26
+			'popular_post_category', // Base ID
27
+			__('GD > Popular Post Category', 'geodirectory'), // Name
28
+			$widget_ops// Args
29
+		);
30
+	}
31
+
32
+	/**
33
+	 * Front-end display content for popular post category widget.
34
+	 *
35
+	 * @since 1.0.0
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)
42
+	{
43
+		geodir_popular_post_category_output($args, $instance);
44
+	}
45
+
46
+	/**
47
+	 * Sanitize popular post category widget form values as they are saved.
48
+	 *
49
+	 * @since 1.0.0
50
+	 * @since 1.5.1 Declare function public.
51
+	 * @since 1.5.1 Added default_post_type parameter.
52
+	 * @since 1.6.9 Added parent_only parameter.
53
+	 *
54
+	 * @param array $new_instance Values just sent to be saved.
55
+	 * @param array $old_instance Previously saved values from database.
56
+	 *
57
+	 * @return array Updated safe values to be saved.
58
+	 */ 
59
+	public function update($new_instance, $old_instance)
60
+	{
61
+		//save the widget
62
+		$instance = $old_instance;
63
+		$instance['title'] = strip_tags($new_instance['title']);
64
+		$category_limit = (int)$new_instance['category_limit'];
65
+		$instance['category_limit'] = $category_limit > 0 ? $category_limit : 15;
66
+		$instance['default_post_type'] = isset($new_instance['default_post_type']) ? $new_instance['default_post_type'] : '';
67
+		$instance['parent_only'] = !empty($new_instance['parent_only']) ? true : false;
68
+		return $instance;
69
+	}
70
+
71
+	/**
72
+	 * Back-end popular post category widget settings form.
73
+	 *
74
+	 * @since 1.0.0
75
+	 * @since 1.5.1 Declare function public.
76
+	 * @since 1.5.1 Added option to set default post type.
77
+	 * @since 1.6.9 Added option to show parent categories only.
78
+	 *
79
+	 * @param array $instance Previously saved values from database.
80
+	 */
81
+	public function form($instance) 
82
+	{
83
+		//widgetform in backend
84
+		$instance = wp_parse_args((array)$instance, array('title' => '', 'category_limit' => 15, 'default_post_type' => '', 'parent_only' => false));
85
+
86
+		$title = strip_tags($instance['title']);
87
+		$category_limit = (int)$instance['category_limit'];
88
+		$category_limit = $category_limit > 0 ? $category_limit : 15;
89
+		$default_post_type = isset($instance['default_post_type']) ? $instance['default_post_type'] : '';
90
+		$parent_only = !empty($instance['parent_only']) ? true: false;
91 91
         
92
-        $post_type_options = geodir_get_posttypes('options');
93
-        ?>
92
+		$post_type_options = geodir_get_posttypes('options');
93
+		?>
94 94
         <p>
95 95
             <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory'); ?>
96 96
                 <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>"/>
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
             <label for="<?php echo $this->get_field_id('parent_only'); ?>"><?php _e( 'Show parent categories only', 'geodirectory' ); ?></label>
117 117
         </p>
118 118
     <?php
119
-    }
119
+	}
120 120
 } // class geodir_popular_post_category
121 121
 
122 122
 register_widget('geodir_popular_post_category');
@@ -130,40 +130,40 @@  discard block
 block discarded – undo
130 130
 class geodir_popular_postview extends WP_Widget
131 131
 {
132 132
 
133
-    /**
133
+	/**
134 134
 	 * Register the popular posts widget.
135 135
 	 *
136 136
 	 * @since 1.0.0
137
-     * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
137
+	 * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
138 138
 	 */
139
-    public function __construct() {
140
-        $widget_ops = array('classname' => 'geodir_popular_post_view', 'description' => __('GD > Popular Post View', 'geodirectory'));
141
-        parent::__construct(
142
-            'popular_post_view', // Base ID
143
-            __('GD > Popular Post View', 'geodirectory'), // Name
144
-            $widget_ops// Args
145
-        );
146
-    }
139
+	public function __construct() {
140
+		$widget_ops = array('classname' => 'geodir_popular_post_view', 'description' => __('GD > Popular Post View', 'geodirectory'));
141
+		parent::__construct(
142
+			'popular_post_view', // Base ID
143
+			__('GD > Popular Post View', 'geodirectory'), // Name
144
+			$widget_ops// Args
145
+		);
146
+	}
147 147
 
148 148
 	/**
149 149
 	 * Front-end display content for popular posts widget.
150 150
 	 *
151 151
 	 * @since 1.0.0
152
-     * @since 1.5.1 Declare function public.
152
+	 * @since 1.5.1 Declare function public.
153 153
 	 *
154 154
 	 * @param array $args     Widget arguments.
155 155
 	 * @param array $instance Saved values from database.
156 156
 	 */
157 157
 	public function widget($args, $instance)
158
-    {
159
-        geodir_popular_postview_output($args, $instance);
160
-    }
158
+	{
159
+		geodir_popular_postview_output($args, $instance);
160
+	}
161 161
 
162 162
 	/**
163 163
 	 * Sanitize popular posts widget form values as they are saved.
164 164
 	 *
165 165
 	 * @since 1.0.0
166
-     * @since 1.5.1 Declare function public.
166
+	 * @since 1.5.1 Declare function public.
167 167
 	 *
168 168
 	 * @param array $new_instance Values just sent to be saved.
169 169
 	 * @param array $old_instance Previously saved values from database.
@@ -171,99 +171,99 @@  discard block
 block discarded – undo
171 171
 	 * @return array Updated safe values to be saved.
172 172
 	 */
173 173
 	public function update($new_instance, $old_instance)
174
-    {
175
-        //save the widget
176
-        $instance = $old_instance;
177
-
178
-        if ($new_instance['title'] == '') {
179
-            $title = geodir_ucwords(strip_tags($new_instance['category_title']));
180
-            //$instance['title'] = $title;
181
-        }
182
-        $instance['title'] = strip_tags($new_instance['title']);
183
-
184
-        $instance['post_type'] = strip_tags($new_instance['post_type']);
185
-        //$instance['category'] = strip_tags($new_instance['category']);
186
-        $instance['category'] = isset($new_instance['category']) ? $new_instance['category'] : '';
187
-        $instance['category_title'] = strip_tags($new_instance['category_title']);
188
-        $instance['post_number'] = strip_tags($new_instance['post_number']);
189
-        $instance['layout'] = strip_tags($new_instance['layout']);
190
-        $instance['listing_width'] = strip_tags($new_instance['listing_width']);
191
-        $instance['list_sort'] = strip_tags($new_instance['list_sort']);
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';
197
-
198
-        $instance['show_featured_only'] = isset($new_instance['show_featured_only']) && $new_instance['show_featured_only'] ? 1 : 0;
199
-        $instance['show_special_only'] = isset($new_instance['show_special_only']) && $new_instance['show_special_only'] ? 1 : 0;
200
-        $instance['with_pics_only'] = isset($new_instance['with_pics_only']) && $new_instance['with_pics_only'] ? 1 : 0;
201
-        $instance['with_videos_only'] = isset($new_instance['with_videos_only']) && $new_instance['with_videos_only'] ? 1 : 0;
202
-        $instance['use_viewing_post_type'] = isset($new_instance['use_viewing_post_type']) && $new_instance['use_viewing_post_type'] ? 1 : 0;
203
-
204
-        return $instance;
205
-    }
174
+	{
175
+		//save the widget
176
+		$instance = $old_instance;
177
+
178
+		if ($new_instance['title'] == '') {
179
+			$title = geodir_ucwords(strip_tags($new_instance['category_title']));
180
+			//$instance['title'] = $title;
181
+		}
182
+		$instance['title'] = strip_tags($new_instance['title']);
183
+
184
+		$instance['post_type'] = strip_tags($new_instance['post_type']);
185
+		//$instance['category'] = strip_tags($new_instance['category']);
186
+		$instance['category'] = isset($new_instance['category']) ? $new_instance['category'] : '';
187
+		$instance['category_title'] = strip_tags($new_instance['category_title']);
188
+		$instance['post_number'] = strip_tags($new_instance['post_number']);
189
+		$instance['layout'] = strip_tags($new_instance['layout']);
190
+		$instance['listing_width'] = strip_tags($new_instance['listing_width']);
191
+		$instance['list_sort'] = strip_tags($new_instance['list_sort']);
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';
197
+
198
+		$instance['show_featured_only'] = isset($new_instance['show_featured_only']) && $new_instance['show_featured_only'] ? 1 : 0;
199
+		$instance['show_special_only'] = isset($new_instance['show_special_only']) && $new_instance['show_special_only'] ? 1 : 0;
200
+		$instance['with_pics_only'] = isset($new_instance['with_pics_only']) && $new_instance['with_pics_only'] ? 1 : 0;
201
+		$instance['with_videos_only'] = isset($new_instance['with_videos_only']) && $new_instance['with_videos_only'] ? 1 : 0;
202
+		$instance['use_viewing_post_type'] = isset($new_instance['use_viewing_post_type']) && $new_instance['use_viewing_post_type'] ? 1 : 0;
203
+
204
+		return $instance;
205
+	}
206 206
 
207 207
 	/**
208 208
 	 * Back-end popular posts widget settings form.
209 209
 	 *
210 210
 	 * @since 1.0.0
211
-     * @since 1.5.1 Declare function public.
211
+	 * @since 1.5.1 Declare function public.
212 212
 	 *
213 213
 	 * @param array $instance Previously saved values from database.
214 214
 	 */
215 215
 	public function form($instance)
216
-    {
217
-        //widgetform in backend
218
-        $instance = wp_parse_args((array)$instance,
219
-            array('title' => '',
220
-                'post_type' => '',
221
-                'category' => array(),
222
-                'category_title' => '',
223
-                'list_sort' => '',
224
-                'list_order' => '',
225
-                'post_number' => '5',
226
-                'layout' => 'gridview_onehalf',
227
-                'listing_width' => '',
228
-                'add_location_filter' => '1',
229
-                'character_count' => '20',
230
-                'show_featured_only' => '',
231
-                'show_special_only' => '',
232
-                'with_pics_only' => '',
233
-                'with_videos_only' => '',
234
-                'use_viewing_post_type' => ''
235
-            )
236
-        );
216
+	{
217
+		//widgetform in backend
218
+		$instance = wp_parse_args((array)$instance,
219
+			array('title' => '',
220
+				'post_type' => '',
221
+				'category' => array(),
222
+				'category_title' => '',
223
+				'list_sort' => '',
224
+				'list_order' => '',
225
+				'post_number' => '5',
226
+				'layout' => 'gridview_onehalf',
227
+				'listing_width' => '',
228
+				'add_location_filter' => '1',
229
+				'character_count' => '20',
230
+				'show_featured_only' => '',
231
+				'show_special_only' => '',
232
+				'with_pics_only' => '',
233
+				'with_videos_only' => '',
234
+				'use_viewing_post_type' => ''
235
+			)
236
+		);
237 237
 
238
-        $title = strip_tags($instance['title']);
238
+		$title = strip_tags($instance['title']);
239 239
 
240
-        $post_type = strip_tags($instance['post_type']);
240
+		$post_type = strip_tags($instance['post_type']);
241 241
 
242
-        $category = $instance['category'];
242
+		$category = $instance['category'];
243 243
 
244
-        $category_title = strip_tags($instance['category_title']);
244
+		$category_title = strip_tags($instance['category_title']);
245 245
 
246
-        $list_sort = strip_tags($instance['list_sort']);
246
+		$list_sort = strip_tags($instance['list_sort']);
247 247
 
248
-        $list_order = strip_tags($instance['list_order']);
248
+		$list_order = strip_tags($instance['list_order']);
249 249
 
250
-        $post_number = strip_tags($instance['post_number']);
250
+		$post_number = strip_tags($instance['post_number']);
251 251
 
252
-        $layout = strip_tags($instance['layout']);
252
+		$layout = strip_tags($instance['layout']);
253 253
 
254
-        $listing_width = strip_tags($instance['listing_width']);
254
+		$listing_width = strip_tags($instance['listing_width']);
255 255
 
256
-        $add_location_filter = strip_tags($instance['add_location_filter']);
256
+		$add_location_filter = strip_tags($instance['add_location_filter']);
257 257
 
258
-        $character_count = $instance['character_count'];
258
+		$character_count = $instance['character_count'];
259 259
 
260
-        $show_featured_only = isset($instance['show_featured_only']) && $instance['show_featured_only'] ? true : false;
261
-        $show_special_only = isset($instance['show_special_only']) && $instance['show_special_only'] ? true : false;
262
-        $with_pics_only = isset($instance['with_pics_only']) && $instance['with_pics_only'] ? true : false;
263
-        $with_videos_only = isset($instance['with_videos_only']) && $instance['with_videos_only'] ? true : false;
264
-        $use_viewing_post_type = isset($instance['use_viewing_post_type']) && $instance['use_viewing_post_type'] ? true : false;
260
+		$show_featured_only = isset($instance['show_featured_only']) && $instance['show_featured_only'] ? true : false;
261
+		$show_special_only = isset($instance['show_special_only']) && $instance['show_special_only'] ? true : false;
262
+		$with_pics_only = isset($instance['with_pics_only']) && $instance['with_pics_only'] ? true : false;
263
+		$with_videos_only = isset($instance['with_videos_only']) && $instance['with_videos_only'] ? true : false;
264
+		$use_viewing_post_type = isset($instance['use_viewing_post_type']) && $instance['use_viewing_post_type'] ? true : false;
265 265
 
266
-        ?>
266
+		?>
267 267
 
268 268
         <p>
269 269
             <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?>
@@ -298,9 +298,9 @@  discard block
 block discarded – undo
298 298
                     <?php foreach ($postypes as $postypes_obj) { ?>
299 299
 
300 300
                         <option <?php if ($post_type == $postypes_obj) {
301
-                            echo 'selected="selected"';
302
-                        } ?> value="<?php echo $postypes_obj; ?>"><?php $extvalue = explode('_', $postypes_obj);
303
-                            echo ucfirst($extvalue[1]); ?></option>
301
+							echo 'selected="selected"';
302
+						} ?> value="<?php echo $postypes_obj; ?>"><?php $extvalue = explode('_', $postypes_obj);
303
+							echo ucfirst($extvalue[1]); ?></option>
304 304
 
305 305
                     <?php } ?>
306 306
 
@@ -315,30 +315,30 @@  discard block
 block discarded – undo
315 315
 
316 316
                 <?php
317 317
 
318
-                $post_type = ($post_type != '') ? $post_type : 'gd_place';
318
+				$post_type = ($post_type != '') ? $post_type : 'gd_place';
319 319
 
320
-                $all_postypes = geodir_get_posttypes();
320
+				$all_postypes = geodir_get_posttypes();
321 321
 
322
-                if (!in_array($post_type, $all_postypes))
323
-                    $post_type = 'gd_place';
322
+				if (!in_array($post_type, $all_postypes))
323
+					$post_type = 'gd_place';
324 324
 
325
-                $category_taxonomy = geodir_get_taxonomies($post_type);
326
-                $categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC'));
325
+				$category_taxonomy = geodir_get_taxonomies($post_type);
326
+				$categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC'));
327 327
 
328
-                ?>
328
+				?>
329 329
 
330 330
                 <select multiple="multiple" class="widefat" name="<?php echo $this->get_field_name('category'); ?>[]"
331 331
                         onchange="geodir_popular_widget_cat_title(this)">
332 332
 
333 333
                     <option <?php if (!is_array($category) || (is_array($category) && in_array('0', $category))) {
334
-                        echo 'selected="selected"';
335
-                    } ?> value="0"><?php _e('All', 'geodirectory'); ?></option>
334
+						echo 'selected="selected"';
335
+					} ?> value="0"><?php _e('All', 'geodirectory'); ?></option>
336 336
                     <?php foreach ($categories as $category_obj) {
337
-                        $selected = '';
338
-                        if (is_array($category) && in_array($category_obj->term_id, $category))
339
-                            echo $selected = 'selected="selected"';
337
+						$selected = '';
338
+						if (is_array($category) && in_array($category_obj->term_id, $category))
339
+							echo $selected = 'selected="selected"';
340 340
 
341
-                        ?>
341
+						?>
342 342
 
343 343
                         <option <?php echo $selected; ?>
344 344
                             value="<?php echo $category_obj->term_id; ?>"><?php echo ucfirst($category_obj->name); ?></option>
@@ -363,28 +363,28 @@  discard block
 block discarded – undo
363 363
                         name="<?php echo $this->get_field_name('list_sort'); ?>">
364 364
 
365 365
                     <option <?php if ($list_sort == 'az') {
366
-                        echo 'selected="selected"';
367
-                    } ?> value="az"><?php _e('A-Z', 'geodirectory'); ?></option>
366
+						echo 'selected="selected"';
367
+					} ?> value="az"><?php _e('A-Z', 'geodirectory'); ?></option>
368 368
 
369 369
                     <option <?php if ($list_sort == 'latest') {
370
-                        echo 'selected="selected"';
371
-                    } ?> value="latest"><?php _e('Latest', 'geodirectory'); ?></option>
370
+						echo 'selected="selected"';
371
+					} ?> value="latest"><?php _e('Latest', 'geodirectory'); ?></option>
372 372
 
373 373
                     <option <?php if ($list_sort == 'featured') {
374
-                        echo 'selected="selected"';
375
-                    } ?> value="featured"><?php _e('Featured', 'geodirectory'); ?></option>
374
+						echo 'selected="selected"';
375
+					} ?> value="featured"><?php _e('Featured', 'geodirectory'); ?></option>
376 376
 
377 377
                     <option <?php if ($list_sort == 'high_review') {
378
-                        echo 'selected="selected"';
379
-                    } ?> value="high_review"><?php _e('Review', 'geodirectory'); ?></option>
378
+						echo 'selected="selected"';
379
+					} ?> value="high_review"><?php _e('Review', 'geodirectory'); ?></option>
380 380
 
381 381
                     <option <?php if ($list_sort == 'high_rating') {
382
-                        echo 'selected="selected"';
383
-                    } ?> value="high_rating"><?php _e('Rating', 'geodirectory'); ?></option>
382
+						echo 'selected="selected"';
383
+					} ?> value="high_rating"><?php _e('Rating', 'geodirectory'); ?></option>
384 384
 
385 385
                     <option <?php if ($list_sort == 'random') {
386
-                        echo 'selected="selected"';
387
-                    } ?> value="random"><?php _e('Random', 'geodirectory'); ?></option>
386
+						echo 'selected="selected"';
387
+					} ?> value="random"><?php _e('Random', 'geodirectory'); ?></option>
388 388
 
389 389
                 </select>
390 390
             </label>
@@ -407,24 +407,24 @@  discard block
 block discarded – undo
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') {
410
-                        echo 'selected="selected"';
411
-                    } ?>
410
+						echo 'selected="selected"';
411
+					} ?>
412 412
                         value="gridview_onehalf"><?php _e('Grid View (Two Columns)', 'geodirectory'); ?></option>
413 413
                     <option <?php if ($layout == 'gridview_onethird') {
414
-                        echo 'selected="selected"';
415
-                    } ?>
414
+						echo 'selected="selected"';
415
+					} ?>
416 416
                         value="gridview_onethird"><?php _e('Grid View (Three Columns)', 'geodirectory'); ?></option>
417 417
                     <option <?php if ($layout == 'gridview_onefourth') {
418
-                        echo 'selected="selected"';
419
-                    } ?>
418
+						echo 'selected="selected"';
419
+					} ?>
420 420
                         value="gridview_onefourth"><?php _e('Grid View (Four Columns)', 'geodirectory'); ?></option>
421 421
                     <option <?php if ($layout == 'gridview_onefifth') {
422
-                        echo 'selected="selected"';
423
-                    } ?>
422
+						echo 'selected="selected"';
423
+					} ?>
424 424
                         value="gridview_onefifth"><?php _e('Grid View (Five Columns)', 'geodirectory'); ?></option>
425 425
                     <option <?php if ($layout == 'list') {
426
-                        echo 'selected="selected"';
427
-                    } ?> value="list"><?php _e('List view', 'geodirectory'); ?></option>
426
+						echo 'selected="selected"';
427
+					} ?> value="list"><?php _e('List view', 'geodirectory'); ?></option>
428 428
 
429 429
                 </select>
430 430
             </label>
@@ -494,8 +494,8 @@  discard block
 block discarded – undo
494 494
                 for="<?php echo $this->get_field_id('use_viewing_post_type'); ?>"><?php _e('Use current viewing post type:', 'geodirectory'); ?>
495 495
                 <input type="checkbox" id="<?php echo $this->get_field_id('use_viewing_post_type'); ?>"
496 496
                        name="<?php echo $this->get_field_name('use_viewing_post_type'); ?>" <?php if ($use_viewing_post_type) {
497
-                    echo 'checked="checked"';
498
-                } ?>  value="1"/>
497
+					echo 'checked="checked"';
498
+				} ?>  value="1"/>
499 499
             </label>
500 500
         </p>
501 501
 
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
         </script>
540 540
 
541 541
     <?php
542
-    }
542
+	}
543 543
 } // class geodir_popular_postview
544 544
 
545 545
 register_widget('geodir_popular_postview');
546 546
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         //save the widget
62 62
         $instance = $old_instance;
63 63
         $instance['title'] = strip_tags($new_instance['title']);
64
-        $category_limit = (int)$new_instance['category_limit'];
64
+        $category_limit = (int) $new_instance['category_limit'];
65 65
         $instance['category_limit'] = $category_limit > 0 ? $category_limit : 15;
66 66
         $instance['default_post_type'] = isset($new_instance['default_post_type']) ? $new_instance['default_post_type'] : '';
67 67
         $instance['parent_only'] = !empty($new_instance['parent_only']) ? true : false;
@@ -81,13 +81,13 @@  discard block
 block discarded – undo
81 81
     public function form($instance) 
82 82
     {
83 83
         //widgetform in backend
84
-        $instance = wp_parse_args((array)$instance, array('title' => '', 'category_limit' => 15, 'default_post_type' => '', 'parent_only' => false));
84
+        $instance = wp_parse_args((array) $instance, array('title' => '', 'category_limit' => 15, 'default_post_type' => '', 'parent_only' => false));
85 85
 
86 86
         $title = strip_tags($instance['title']);
87
-        $category_limit = (int)$instance['category_limit'];
87
+        $category_limit = (int) $instance['category_limit'];
88 88
         $category_limit = $category_limit > 0 ? $category_limit : 15;
89 89
         $default_post_type = isset($instance['default_post_type']) ? $instance['default_post_type'] : '';
90
-        $parent_only = !empty($instance['parent_only']) ? true: false;
90
+        $parent_only = !empty($instance['parent_only']) ? true : false;
91 91
         
92 92
         $post_type_options = geodir_get_posttypes('options');
93 93
         ?>
@@ -97,23 +97,23 @@  discard block
 block discarded – undo
97 97
             </label>
98 98
         </p>
99 99
         <p>
100
-            <label for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Default post type to use (if not set by page)', 'geodirectory');?>
100
+            <label for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Default post type to use (if not set by page)', 'geodirectory'); ?>
101 101
                 <select class="widefat" id="<?php echo $this->get_field_id('default_post_type'); ?>" name="<?php echo $this->get_field_name('default_post_type'); ?>">
102 102
                 <?php foreach ($post_type_options as $name => $title) { ?>
103
-                    <option value="<?php echo $name;?>" <?php selected($name, $default_post_type);?>><?php echo $title; ?></option>
103
+                    <option value="<?php echo $name; ?>" <?php selected($name, $default_post_type); ?>><?php echo $title; ?></option>
104 104
                 <?php } ?>
105 105
                 </select>
106 106
             </label>
107 107
         </p>
108 108
         <p>
109 109
             <label for="<?php echo $this->get_field_id('category_limit'); ?>"><?php _e('Customize categories count to appear by default:', 'geodirectory'); ?>
110
-                <input class="widefat" id="<?php echo $this->get_field_id('category_limit'); ?>" name="<?php echo $this->get_field_name('category_limit'); ?>" type="text" value="<?php echo (int)esc_attr($category_limit); ?>"/>
110
+                <input class="widefat" id="<?php echo $this->get_field_id('category_limit'); ?>" name="<?php echo $this->get_field_name('category_limit'); ?>" type="text" value="<?php echo (int) esc_attr($category_limit); ?>"/>
111 111
                 <p class="description" 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>
112 112
             </label>
113 113
         </p>
114 114
         <p>
115
-            <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('parent_only'); ?>" name="<?php echo $this->get_field_name('parent_only'); ?>"<?php checked( $parent_only ); ?> value="1" />
116
-            <label for="<?php echo $this->get_field_id('parent_only'); ?>"><?php _e( 'Show parent categories only', 'geodirectory' ); ?></label>
115
+            <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('parent_only'); ?>" name="<?php echo $this->get_field_name('parent_only'); ?>"<?php checked($parent_only); ?> value="1" />
116
+            <label for="<?php echo $this->get_field_id('parent_only'); ?>"><?php _e('Show parent categories only', 'geodirectory'); ?></label>
117 117
         </p>
118 118
     <?php
119 119
     }
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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 } ?>
Please login to merge, or discard this patch.
geodirectory-widgets/geodirectory_reviews_widget.php 2 patches
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -14,37 +14,37 @@  discard block
 block discarded – undo
14 14
  */
15 15
 class geodir_recent_reviews_widget extends WP_Widget
16 16
 {
17
-    /**
17
+	/**
18 18
 	 * Register the recent reviews widget.
19 19
 	 *
20 20
 	 * @since 1.0.0
21
-     * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
21
+	 * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
22 22
 	 */
23
-    public function __construct() {
24
-        $widget_ops = array('classname' => 'geodir_recent_reviews', 'description' => __('GD > Recent Reviews', 'geodirectory'));
25
-        parent::__construct(
26
-            'geodir_recent_reviews', // Base ID
27
-            __('GD > Recent Reviews', 'geodirectory'), // Name
28
-            $widget_ops// Args
29
-        );
30
-    }
23
+	public function __construct() {
24
+		$widget_ops = array('classname' => 'geodir_recent_reviews', 'description' => __('GD > Recent Reviews', 'geodirectory'));
25
+		parent::__construct(
26
+			'geodir_recent_reviews', // Base ID
27
+			__('GD > Recent Reviews', 'geodirectory'), // Name
28
+			$widget_ops// Args
29
+		);
30
+	}
31 31
 
32 32
 	/**
33 33
 	 * Front-end display content for recent reviews widget.
34 34
 	 *
35 35
 	 * @since 1.0.0
36
-     * @since 1.5.1 Declare function public.
36
+	 * @since 1.5.1 Declare function public.
37 37
 	 *
38 38
 	 * @param array $args     Widget arguments.
39 39
 	 * @param array $instance Saved values from database.
40 40
 	 */
41 41
 	public function widget($args, $instance)
42
-    {
43
-        // prints the widget
44
-        extract($args, EXTR_SKIP);
42
+	{
43
+		// prints the widget
44
+		extract($args, EXTR_SKIP);
45 45
 
46
-        /** This filter is documented in geodirectory_widgets.php */
47
-        $title = empty($instance['title']) ? '' : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
46
+		/** This filter is documented in geodirectory_widgets.php */
47
+		$title = empty($instance['title']) ? '' : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
48 48
 		
49 49
 		/**
50 50
 		 * Filter the number of reviews to display.
@@ -63,35 +63,35 @@  discard block
 block discarded – undo
63 63
 		 * @param int $g_size Height and width of the avatar image in pixels. Default 30.
64 64
 		 */
65 65
 		$g_size = apply_filters('geodir_recent_reviews_g_size', 30);
66
-        /**
67
-         * Filter the excerpt length
68
-         *
69
-         * @since 1.0.0
70
-         *
71
-         * @param int $excerpt_length Excerpt length. Default 100.
72
-         */
73
-        $excerpt_length = apply_filters('geodir_recent_reviews_excerpt_length', 100);
74
-        $comments_li = geodir_get_recent_reviews($g_size, $count, $excerpt_length, false);
66
+		/**
67
+		 * Filter the excerpt length
68
+		 *
69
+		 * @since 1.0.0
70
+		 *
71
+		 * @param int $excerpt_length Excerpt length. Default 100.
72
+		 */
73
+		$excerpt_length = apply_filters('geodir_recent_reviews_excerpt_length', 100);
74
+		$comments_li = geodir_get_recent_reviews($g_size, $count, $excerpt_length, false);
75 75
 
76
-        if ($comments_li) {
77
-            echo $before_widget;
78
-            ?>
76
+		if ($comments_li) {
77
+			echo $before_widget;
78
+			?>
79 79
             <div class="widget geodir_recent_reviews_section">
80 80
                 <?php if ($title) {
81
-                    echo $before_title . $title . $after_title;
82
-                } ?>
81
+					echo $before_title . $title . $after_title;
82
+				} ?>
83 83
                 <ul class="geodir_recent_reviews"><?php echo $comments_li; ?></ul>
84 84
             </div>
85 85
             <?php
86
-            echo $after_widget;
87
-        }
88
-    }
86
+			echo $after_widget;
87
+		}
88
+	}
89 89
 
90 90
 	/**
91 91
 	 * Sanitize recent reviews widget form values as they are saved.
92 92
 	 *
93 93
 	 * @since 1.0.0
94
-     * @since 1.5.1 Declare function public.
94
+	 * @since 1.5.1 Declare function public.
95 95
 	 *
96 96
 	 * @param array $new_instance Values just sent to be saved.
97 97
 	 * @param array $old_instance Previously saved values from database.
@@ -99,29 +99,29 @@  discard block
 block discarded – undo
99 99
 	 * @return array Updated safe values to be saved.
100 100
 	 */
101 101
 	public function update($new_instance, $old_instance)
102
-    {
103
-        //save the widget
104
-        $instance = $old_instance;
105
-        $instance['title'] = strip_tags($new_instance['title']);
106
-        $instance['count'] = strip_tags($new_instance['count']);
107
-        return $instance;
108
-    }
102
+	{
103
+		//save the widget
104
+		$instance = $old_instance;
105
+		$instance['title'] = strip_tags($new_instance['title']);
106
+		$instance['count'] = strip_tags($new_instance['count']);
107
+		return $instance;
108
+	}
109 109
     
110 110
 	/**
111 111
 	 * Back-end recent reviews widget settings form.
112 112
 	 *
113 113
 	 * @since 1.0.0
114
-     * @since 1.5.1 Declare function public.
114
+	 * @since 1.5.1 Declare function public.
115 115
 	 *
116 116
 	 * @param array $instance Previously saved values from database.
117 117
 	 */
118 118
 	public function form($instance)
119
-    {
120
-        //widgetform in backend
121
-        $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'count' => ''));
122
-        $title = strip_tags($instance['title']);
123
-        $count = strip_tags($instance['count']);
124
-        ?>
119
+	{
120
+		//widgetform in backend
121
+		$instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'count' => ''));
122
+		$title = strip_tags($instance['title']);
123
+		$count = strip_tags($instance['count']);
124
+		?>
125 125
         <p><label for="<?php echo $this->get_field_id('title'); ?>">Widget Title: <input class="widefat"
126 126
                                                                                          id="<?php echo $this->get_field_id('title'); ?>"
127 127
                                                                                          name="<?php echo $this->get_field_name('title'); ?>"
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
                                                                                              value="<?php echo esc_attr($count); ?>"/></label>
136 136
         </p>
137 137
     <?php
138
-    }
138
+	}
139 139
 } // class geodir_recent_reviews_widget
140 140
 
141 141
 register_widget('geodir_recent_reviews_widget');
142 142
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             ?>
79 79
             <div class="widget geodir_recent_reviews_section">
80 80
                 <?php if ($title) {
81
-                    echo $before_title . $title . $after_title;
81
+                    echo $before_title.$title.$after_title;
82 82
                 } ?>
83 83
                 <ul class="geodir_recent_reviews"><?php echo $comments_li; ?></ul>
84 84
             </div>
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
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
         ?>
Please login to merge, or discard this patch.
geodirectory-widgets/geodirectory_bestof_widget.php 3 patches
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -118,10 +118,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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>
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
          * @param string $instance ['tab_layout'] Best of widget tab layout name.
52 52
          */
53 53
         $tab_layout = empty($instance['tab_layout']) ? 'bestof-tabs-on-top' : apply_filters('bestof_widget_tab_layout', $instance['tab_layout']);
54
-        echo '<div class="bestof-widget-tab-layout ' . $tab_layout . '">';
54
+        echo '<div class="bestof-widget-tab-layout '.$tab_layout.'">';
55 55
         echo $before_widget;
56 56
         $loc_terms = geodir_get_current_location_terms();
57 57
         if (!empty($loc_terms)) {
58
-            $cur_location = ' : ' . geodir_ucwords(str_replace('-', ' ', end($loc_terms)));
58
+            $cur_location = ' : '.geodir_ucwords(str_replace('-', ' ', end($loc_terms)));
59 59
         } else {
60 60
             $cur_location = '';
61 61
         }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
          *
77 77
          * @param string $instance ['title'] The widget title.
78 78
          */
79
-        $title = empty($instance['title']) ? wp_sprintf(__('Best of %s', 'geodirectory'), get_bloginfo('name') . $cur_location) : apply_filters('bestof_widget_title', __($instance['title'], 'geodirectory'));
79
+        $title = empty($instance['title']) ? wp_sprintf(__('Best of %s', 'geodirectory'), get_bloginfo('name').$cur_location) : apply_filters('bestof_widget_title', __($instance['title'], 'geodirectory'));
80 80
 
81 81
         /**
82 82
          * Filter the post type.
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         }
203 203
 
204 204
 
205
-        echo $before_title . __($title,'geodirectory') . $after_title;
205
+        echo $before_title.__($title, 'geodirectory').$after_title;
206 206
 
207 207
         //term navigation - start
208 208
         echo '<div class="geodir-tabs gd-bestof-tabs" id="gd-bestof-tabs" style="position:relative;">';
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
             $is_dropdown = ($tab_layout == 'bestof-tabs-as-dropdown') ? true : false;
214 214
 
215 215
             if ($is_dropdown) {
216
-                $nav_html .= '<select id="geodir_bestof_tab_dd" class="chosen_select" name="geodir_bestof_tab_dd" data-placeholder="' . esc_attr(__('Select Category', 'geodirectory')) . '">';
216
+                $nav_html .= '<select id="geodir_bestof_tab_dd" class="chosen_select" name="geodir_bestof_tab_dd" data-placeholder="'.esc_attr(__('Select Category', 'geodirectory')).'">';
217 217
             } else {
218 218
                 $nav_html .= '<dl class="geodir-tab-head geodir-bestof-cat-list">';
219 219
                 $nav_html .= '<dt></dt>';
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
                     }
231 231
                     if ($is_dropdown) {
232 232
                         $selected = ($cat_count == 1) ? 'selected="selected"' : '';
233
-                        $nav_html .= '<option ' . $selected . ' value="' . $cat->term_id . '">' . geodir_ucwords($cat->name) . '</option>';
233
+                        $nav_html .= '<option '.$selected.' value="'.$cat->term_id.'">'.geodir_ucwords($cat->name).'</option>';
234 234
                     } else {
235 235
                         if ($cat_count == 1) {
236 236
                             $nav_html .= '<dd class="geodir-tab-active">';
@@ -238,8 +238,8 @@  discard block
 block discarded – undo
238 238
                             $nav_html .= '<dd class="">';
239 239
                         }
240 240
                         $term_icon_url = !empty($term_icon) && isset($term_icon[$cat->term_id]) ? $term_icon[$cat->term_id] : '';
241
-                        $nav_html .= '<a data-termid="' . $cat->term_id . '" href="' . get_term_link($cat, $cat->taxonomy) . '">';
242
-                        $nav_html .= '<img alt="' . $cat->name . ' icon" class="bestof-cat-icon" src="' . $term_icon_url . '"/>';
241
+                        $nav_html .= '<a data-termid="'.$cat->term_id.'" href="'.get_term_link($cat, $cat->taxonomy).'">';
242
+                        $nav_html .= '<img alt="'.$cat->name.' icon" class="bestof-cat-icon" src="'.$term_icon_url.'"/>';
243 243
                         $nav_html .= '<span>';
244 244
                         $nav_html .= geodir_ucwords($cat->name);
245 245
                         $nav_html .= '<small>';
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
                             if ($num_reviews == 0) {
249 249
                                 $reviews = __('No Reviews', 'geodirectory');
250 250
                             } elseif ($num_reviews > 1) {
251
-                                $reviews = $num_reviews . __(' Reviews', 'geodirectory');
251
+                                $reviews = $num_reviews.__(' Reviews', 'geodirectory');
252 252
                             } else {
253 253
                                 $reviews = __('1 Review', 'geodirectory');
254 254
                             }
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
                  */
322 322
                 $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $first_term);
323 323
 
324
-                echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $first_term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>';
324
+                echo '<h3 class="bestof-cat-title">'.wp_sprintf(__('Best of %s', 'geodirectory'), $first_term->name).'<a href="'.esc_url($view_all_link).'">'.__("View all", 'geodirectory').'</a></h3>';
325 325
             }
326 326
             if ($excerpt_type == 'show-reviews') {
327 327
                 add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
      */
379 379
     public function form($instance)
380 380
     {
381
-        $instance = wp_parse_args((array)$instance,
381
+        $instance = wp_parse_args((array) $instance,
382 382
             array(
383 383
                 'title' => '',
384 384
                 'post_type' => '',
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 
404 404
         ?>
405 405
         <p>
406
-            <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?>
406
+            <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory'); ?>
407 407
 
408 408
                 <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
409 409
                        name="<?php echo $this->get_field_name('title'); ?>" type="text"
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 
414 414
         <p>
415 415
             <label
416
-                for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory');?>
416
+                for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory'); ?>
417 417
 
418 418
                 <?php $postypes = geodir_get_posttypes();
419 419
                 /**
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
         <p>
446 446
 
447 447
             <label
448
-                for="<?php echo $this->get_field_id('post_limit'); ?>"><?php _e('Number of posts:', 'geodirectory');?>
448
+                for="<?php echo $this->get_field_id('post_limit'); ?>"><?php _e('Number of posts:', 'geodirectory'); ?>
449 449
 
450 450
                 <input class="widefat" id="<?php echo $this->get_field_id('post_limit'); ?>"
451 451
                        name="<?php echo $this->get_field_name('post_limit'); ?>" type="text"
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
         <p>
457 457
 
458 458
             <label
459
-                for="<?php echo $this->get_field_id('categ_limit'); ?>"><?php _e('Number of categories:', 'geodirectory');?>
459
+                for="<?php echo $this->get_field_id('categ_limit'); ?>"><?php _e('Number of categories:', 'geodirectory'); ?>
460 460
 
461 461
                 <input class="widefat" id="<?php echo $this->get_field_id('categ_limit'); ?>"
462 462
                        name="<?php echo $this->get_field_name('categ_limit'); ?>" type="text"
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
 
467 467
         <p>
468 468
             <label
469
-                for="<?php echo $this->get_field_id('character_count'); ?>"><?php _e('Post Content excerpt character count :', 'geodirectory');?>
469
+                for="<?php echo $this->get_field_id('character_count'); ?>"><?php _e('Post Content excerpt character count :', 'geodirectory'); ?>
470 470
                 <input class="widefat" id="<?php echo $this->get_field_id('character_count'); ?>"
471 471
                        name="<?php echo $this->get_field_name('character_count'); ?>" type="text"
472 472
                        value="<?php echo esc_attr($character_count); ?>"/>
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
         </p>
475 475
         <p>
476 476
             <label
477
-                for="<?php echo $this->get_field_id('tab_layout'); ?>"><?php _e('Tab Layout:', 'geodirectory');?>
477
+                for="<?php echo $this->get_field_id('tab_layout'); ?>"><?php _e('Tab Layout:', 'geodirectory'); ?>
478 478
 
479 479
                 <select class="widefat" id="<?php echo $this->get_field_id('tab_layout'); ?>"
480 480
                         name="<?php echo $this->get_field_name('tab_layout'); ?>">
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
 
496 496
         <p>
497 497
             <label
498
-                for="<?php echo $this->get_field_id('excerpt_type'); ?>"><?php _e('Excerpt Type:', 'geodirectory');?>
498
+                for="<?php echo $this->get_field_id('excerpt_type'); ?>"><?php _e('Excerpt Type:', 'geodirectory'); ?>
499 499
 
500 500
                 <select class="widefat" id="<?php echo $this->get_field_id('excerpt_type'); ?>"
501 501
                         name="<?php echo $this->get_field_name('excerpt_type'); ?>">
@@ -512,9 +512,9 @@  discard block
 block discarded – undo
512 512
 
513 513
         <p>
514 514
             <label for="<?php echo $this->get_field_id('add_location_filter'); ?>">
515
-                <?php _e('Enable Location Filter:', 'geodirectory');?>
515
+                <?php _e('Enable Location Filter:', 'geodirectory'); ?>
516 516
                 <input type="checkbox" id="<?php echo $this->get_field_id('add_location_filter'); ?>"
517
-                       name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"';?>
517
+                       name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"'; ?>
518 518
                        value="1"/>
519 519
             </label>
520 520
         </p>
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
         /** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */
663 663
         $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $term);
664 664
 
665
-        echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>';
665
+        echo '<h3 class="bestof-cat-title">'.wp_sprintf(__('Best of %s', 'geodirectory'), $term->name).'<a href="'.esc_url($view_all_link).'">'.__("View all", 'geodirectory').'</a></h3>';
666 666
     }
667 667
     if ($excerpt_type == 'show-reviews') {
668 668
         add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
Please login to merge, or discard this patch.
Indentation   +519 added lines, -519 removed lines patch added patch discarded remove patch
@@ -14,282 +14,282 @@  discard block
 block discarded – undo
14 14
  */
15 15
 class geodir_bestof_widget extends WP_Widget
16 16
 {
17
-    /**
18
-     * Register the best of widget with WordPress.
19
-     *
20
-     * @since 1.3.9
21
-     * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
22
-     */
23
-    public function __construct()
24
-    {
25
-        $widget_ops = array('classname' => 'geodir_bestof_widget', 'description' => __('GD > Best of widget', 'geodirectory'));
26
-        parent::__construct(
27
-            'bestof_widget', // Base ID
28
-            __('GD > Best of widget', 'geodirectory'), // Name
29
-            $widget_ops// Args
30
-        );
31
-    }
32
-
33
-    /**
34
-     * Front-end display content for best of widget.
35
-     *
36
-     * @since 1.3.9
37
-     * @since 1.5.1 Added filter to view all link.
38
-     * @since 1.5.1 Declare function public.
39
-     *
40
-     * @param array $args Widget arguments.
41
-     * @param array $instance Saved values from database.
42
-     */
43
-    public function widget($args, $instance)
44
-    {
45
-        extract($args);
46
-        /**
47
-         * Filter the best of widget tab layout.
48
-         *
49
-         * @since 1.3.9
50
-         *
51
-         * @param string $instance ['tab_layout'] Best of widget tab layout name.
52
-         */
53
-        $tab_layout = empty($instance['tab_layout']) ? 'bestof-tabs-on-top' : apply_filters('bestof_widget_tab_layout', $instance['tab_layout']);
54
-        echo '<div class="bestof-widget-tab-layout ' . $tab_layout . '">';
55
-        echo $before_widget;
56
-        $loc_terms = geodir_get_current_location_terms();
57
-        if (!empty($loc_terms)) {
58
-            $cur_location = ' : ' . geodir_ucwords(str_replace('-', ' ', end($loc_terms)));
59
-        } else {
60
-            $cur_location = '';
61
-        }
62
-
63
-        /**
64
-         * Filter the current location name.
65
-         *
66
-         * @since 1.3.9
67
-         *
68
-         * @param string $cur_location Current location name.
69
-         */
70
-        $cur_location = apply_filters('bestof_widget_cur_location', $cur_location);
71
-
72
-        /**
73
-         * Filter the widget title.
74
-         *
75
-         * @since 1.3.9
76
-         *
77
-         * @param string $instance ['title'] The widget title.
78
-         */
79
-        $title = empty($instance['title']) ? wp_sprintf(__('Best of %s', 'geodirectory'), get_bloginfo('name') . $cur_location) : apply_filters('bestof_widget_title', __($instance['title'], 'geodirectory'));
80
-
81
-        /**
82
-         * Filter the post type.
83
-         *
84
-         * @since 1.3.9
85
-         *
86
-         * @param string $instance ['post_type'] The post type.
87
-         */
88
-        $post_type = empty($instance['post_type']) ? 'gd_place' : apply_filters('bestof_widget_post_type', $instance['post_type']);
89
-
90
-        /**
91
-         * Filter the excerpt type.
92
-         *
93
-         * @since 1.5.4
94
-         *
95
-         * @param string $instance ['excerpt_type'] The excerpt type.
96
-         */
97
-        $excerpt_type = empty($instance['excerpt_type']) ? 'show-desc' : apply_filters('bestof_widget_excerpt_type', $instance['excerpt_type']);
98
-
99
-
100
-        /**
101
-         * Filter the listing limit.
102
-         *
103
-         * @since 1.3.9
104
-         *
105
-         * @param int $instance ['post_limit'] No. of posts to display.
106
-         */
107
-        $post_limit = empty($instance['post_limit']) ? '5' : apply_filters('bestof_widget_post_limit', $instance['post_limit']);
108
-
109
-        /**
110
-         * Filter the category limit.
111
-         *
112
-         * @since 1.3.9
113
-         *
114
-         * @param int $instance ['categ_limit'] No. of categories to display.
115
-         */
116
-        $categ_limit = empty($instance['categ_limit']) ? '3' : apply_filters('bestof_widget_categ_limit', $instance['categ_limit']);
117
-        $use_viewing_post_type = !empty($instance['use_viewing_post_type']) ? true : false;
118
-
119
-        /**
120
-         * Filter the use of location filter.
121
-         *
122
-         * @since 1.3.9
123
-         *
124
-         * @param int|bool $instance ['add_location_filter'] Filter listings using current location.
125
-         */
126
-        $add_location_filter = empty($instance['add_location_filter']) ? '1' : apply_filters('bestof_widget_location_filter', $instance['add_location_filter']);
127
-
128
-        // set post type to current viewing post type
129
-        if ($use_viewing_post_type) {
130
-            $current_post_type = geodir_get_current_posttype();
131
-            if ($current_post_type != '' && $current_post_type != $post_type) {
132
-                $post_type = $current_post_type;
133
-            }
134
-        }
135
-
136
-        if (isset($instance['character_count'])) {
137
-            /**
138
-             * Filter the widget's excerpt character count.
139
-             *
140
-             * @since 1.3.9
141
-             *
142
-             * @param int $instance ['character_count'] Excerpt character count.
143
-             */
144
-            $character_count = apply_filters('bestof_widget_list_character_count', $instance['character_count']);
145
-        } else {
146
-            $character_count = '';
147
-        }
148
-
149
-        $category_taxonomy = geodir_get_taxonomies($post_type);
150
-
151
-        $term_args = array(
152
-            'hide_empty' => true,
153
-            'parent' => 0
154
-        );
155
-
156
-        $term_args = apply_filters('bestof_widget_term_args', $term_args);
157
-
158
-        if (is_tax()) {
159
-            $taxonomy = get_query_var('taxonomy');
160
-            $cur_term = get_query_var('term');
161
-            $term_data = get_term_by('name', $cur_term, $taxonomy);
162
-            $term_args['parent'] = $term_data->term_id;
163
-        }
164
-
165
-        $terms = get_terms($category_taxonomy[0], $term_args);
166
-
167
-        $term_reviews = geodir_count_reviews_by_terms();
168
-        $a_terms = array();
169
-        foreach ($terms as $term) {
170
-
171
-
172
-            if ($term->count > 0) {
173
-                if (isset($term_reviews[$term->term_id])) {
174
-                    $term->review_count = $term_reviews[$term->term_id];
175
-                } else {
176
-                    $term->review_count = '0';
177
-                }
178
-
179
-                $a_terms[] = $term;
180
-            }
181
-
182
-        }
183
-
184
-
185
-        $terms = apply_filters('bestof_widget_sort_terms', geodir_sort_terms($a_terms, 'review_count'), $a_terms);
186
-
187
-        $query_args = array(
188
-            'posts_per_page' => $post_limit,
189
-            'is_geodir_loop' => true,
190
-            'post_type' => $post_type,
191
-            'gd_location' => $add_location_filter ? true : false,
192
-            'order_by' => 'high_review'
193
-        );
194
-        if ($character_count >= 0) {
195
-            $query_args['excerpt_length'] = $character_count;
196
-        }
197
-
198
-        $layout = array();
199
-        if ($tab_layout == 'bestof-tabs-as-dropdown') {
200
-            $layout[] = $tab_layout;
201
-        } else {
202
-            $layout[] = 'bestof-tabs-as-dropdown';
203
-            $layout[] = $tab_layout;
204
-        }
205
-
206
-
207
-        echo $before_title . __($title,'geodirectory') . $after_title;
208
-
209
-        //term navigation - start
210
-        echo '<div class="geodir-tabs gd-bestof-tabs" id="gd-bestof-tabs" style="position:relative;">';
211
-
212
-        $final_html = '';
213
-        foreach ($layout as $tab_layout) {
214
-            $nav_html = '';
215
-            $is_dropdown = ($tab_layout == 'bestof-tabs-as-dropdown') ? true : false;
216
-
217
-            if ($is_dropdown) {
218
-                $nav_html .= '<select id="geodir_bestof_tab_dd" class="chosen_select" name="geodir_bestof_tab_dd" data-placeholder="' . esc_attr(__('Select Category', 'geodirectory')) . '">';
219
-            } else {
220
-                $nav_html .= '<dl class="geodir-tab-head geodir-bestof-cat-list">';
221
-                $nav_html .= '<dt></dt>';
222
-            }
223
-
224
-
225
-            $term_icon = geodir_get_term_icon();
226
-            $cat_count = 0;
227
-            if (!empty($terms)) {
228
-                foreach ($terms as $cat) {
229
-                    $cat_count++;
230
-                    if ($cat_count > $categ_limit) {
231
-                        break;
232
-                    }
233
-                    if ($is_dropdown) {
234
-                        $selected = ($cat_count == 1) ? 'selected="selected"' : '';
235
-                        $nav_html .= '<option ' . $selected . ' value="' . $cat->term_id . '">' . geodir_ucwords($cat->name) . '</option>';
236
-                    } else {
237
-                        if ($cat_count == 1) {
238
-                            $nav_html .= '<dd class="geodir-tab-active">';
239
-                        } else {
240
-                            $nav_html .= '<dd class="">';
241
-                        }
242
-                        $term_icon_url = !empty($term_icon) && isset($term_icon[$cat->term_id]) ? $term_icon[$cat->term_id] : '';
243
-                        $nav_html .= '<a data-termid="' . $cat->term_id . '" href="' . get_term_link($cat, $cat->taxonomy) . '">';
244
-                        $nav_html .= '<img alt="' . $cat->name . ' icon" class="bestof-cat-icon" src="' . $term_icon_url . '"/>';
245
-                        $nav_html .= '<span>';
246
-                        $nav_html .= geodir_ucwords($cat->name);
247
-                        $nav_html .= '<small>';
248
-                        if (isset($cat->review_count)) {
249
-                            $num_reviews = $cat->review_count;
250
-                            if ($num_reviews == 0) {
251
-                                $reviews = __('No Reviews', 'geodirectory');
252
-                            } elseif ($num_reviews > 1) {
253
-                                $reviews = $num_reviews . __(' Reviews', 'geodirectory');
254
-                            } else {
255
-                                $reviews = __('1 Review', 'geodirectory');
256
-                            }
257
-                            $nav_html .= $reviews;
258
-                        }
259
-                        $nav_html .= '</small>';
260
-                        $nav_html .= '</span>';
261
-                        $nav_html .= '</a>';
262
-                        $nav_html .= '</dd>';
263
-                    }
264
-                }
265
-            }
266
-
267
-            if ($is_dropdown) {
268
-                $nav_html .= '</select>';
269
-            } else {
270
-                $nav_html .= '</dl>';
271
-            }
272
-            $final_html .= $nav_html;
273
-        }
274
-        if ($terms) {
275
-            echo $final_html;
276
-        }
277
-        echo '</div>';
278
-        //term navigation - end
279
-
280
-        //first term listings by default - start
281
-        $first_term = '';
282
-        if ($terms) {
283
-            $first_term = $terms[0];
284
-            $tax_query = array(
285
-                'taxonomy' => $category_taxonomy[0],
286
-                'field' => 'id',
287
-                'terms' => $first_term->term_id
288
-            );
289
-            $query_args['tax_query'] = array($tax_query);
290
-        }
291
-
292
-        ?>
17
+	/**
18
+	 * Register the best of widget with WordPress.
19
+	 *
20
+	 * @since 1.3.9
21
+	 * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
22
+	 */
23
+	public function __construct()
24
+	{
25
+		$widget_ops = array('classname' => 'geodir_bestof_widget', 'description' => __('GD > Best of widget', 'geodirectory'));
26
+		parent::__construct(
27
+			'bestof_widget', // Base ID
28
+			__('GD > Best of widget', 'geodirectory'), // Name
29
+			$widget_ops// Args
30
+		);
31
+	}
32
+
33
+	/**
34
+	 * Front-end display content for best of widget.
35
+	 *
36
+	 * @since 1.3.9
37
+	 * @since 1.5.1 Added filter to view all link.
38
+	 * @since 1.5.1 Declare function public.
39
+	 *
40
+	 * @param array $args Widget arguments.
41
+	 * @param array $instance Saved values from database.
42
+	 */
43
+	public function widget($args, $instance)
44
+	{
45
+		extract($args);
46
+		/**
47
+		 * Filter the best of widget tab layout.
48
+		 *
49
+		 * @since 1.3.9
50
+		 *
51
+		 * @param string $instance ['tab_layout'] Best of widget tab layout name.
52
+		 */
53
+		$tab_layout = empty($instance['tab_layout']) ? 'bestof-tabs-on-top' : apply_filters('bestof_widget_tab_layout', $instance['tab_layout']);
54
+		echo '<div class="bestof-widget-tab-layout ' . $tab_layout . '">';
55
+		echo $before_widget;
56
+		$loc_terms = geodir_get_current_location_terms();
57
+		if (!empty($loc_terms)) {
58
+			$cur_location = ' : ' . geodir_ucwords(str_replace('-', ' ', end($loc_terms)));
59
+		} else {
60
+			$cur_location = '';
61
+		}
62
+
63
+		/**
64
+		 * Filter the current location name.
65
+		 *
66
+		 * @since 1.3.9
67
+		 *
68
+		 * @param string $cur_location Current location name.
69
+		 */
70
+		$cur_location = apply_filters('bestof_widget_cur_location', $cur_location);
71
+
72
+		/**
73
+		 * Filter the widget title.
74
+		 *
75
+		 * @since 1.3.9
76
+		 *
77
+		 * @param string $instance ['title'] The widget title.
78
+		 */
79
+		$title = empty($instance['title']) ? wp_sprintf(__('Best of %s', 'geodirectory'), get_bloginfo('name') . $cur_location) : apply_filters('bestof_widget_title', __($instance['title'], 'geodirectory'));
80
+
81
+		/**
82
+		 * Filter the post type.
83
+		 *
84
+		 * @since 1.3.9
85
+		 *
86
+		 * @param string $instance ['post_type'] The post type.
87
+		 */
88
+		$post_type = empty($instance['post_type']) ? 'gd_place' : apply_filters('bestof_widget_post_type', $instance['post_type']);
89
+
90
+		/**
91
+		 * Filter the excerpt type.
92
+		 *
93
+		 * @since 1.5.4
94
+		 *
95
+		 * @param string $instance ['excerpt_type'] The excerpt type.
96
+		 */
97
+		$excerpt_type = empty($instance['excerpt_type']) ? 'show-desc' : apply_filters('bestof_widget_excerpt_type', $instance['excerpt_type']);
98
+
99
+
100
+		/**
101
+		 * Filter the listing limit.
102
+		 *
103
+		 * @since 1.3.9
104
+		 *
105
+		 * @param int $instance ['post_limit'] No. of posts to display.
106
+		 */
107
+		$post_limit = empty($instance['post_limit']) ? '5' : apply_filters('bestof_widget_post_limit', $instance['post_limit']);
108
+
109
+		/**
110
+		 * Filter the category limit.
111
+		 *
112
+		 * @since 1.3.9
113
+		 *
114
+		 * @param int $instance ['categ_limit'] No. of categories to display.
115
+		 */
116
+		$categ_limit = empty($instance['categ_limit']) ? '3' : apply_filters('bestof_widget_categ_limit', $instance['categ_limit']);
117
+		$use_viewing_post_type = !empty($instance['use_viewing_post_type']) ? true : false;
118
+
119
+		/**
120
+		 * Filter the use of location filter.
121
+		 *
122
+		 * @since 1.3.9
123
+		 *
124
+		 * @param int|bool $instance ['add_location_filter'] Filter listings using current location.
125
+		 */
126
+		$add_location_filter = empty($instance['add_location_filter']) ? '1' : apply_filters('bestof_widget_location_filter', $instance['add_location_filter']);
127
+
128
+		// set post type to current viewing post type
129
+		if ($use_viewing_post_type) {
130
+			$current_post_type = geodir_get_current_posttype();
131
+			if ($current_post_type != '' && $current_post_type != $post_type) {
132
+				$post_type = $current_post_type;
133
+			}
134
+		}
135
+
136
+		if (isset($instance['character_count'])) {
137
+			/**
138
+			 * Filter the widget's excerpt character count.
139
+			 *
140
+			 * @since 1.3.9
141
+			 *
142
+			 * @param int $instance ['character_count'] Excerpt character count.
143
+			 */
144
+			$character_count = apply_filters('bestof_widget_list_character_count', $instance['character_count']);
145
+		} else {
146
+			$character_count = '';
147
+		}
148
+
149
+		$category_taxonomy = geodir_get_taxonomies($post_type);
150
+
151
+		$term_args = array(
152
+			'hide_empty' => true,
153
+			'parent' => 0
154
+		);
155
+
156
+		$term_args = apply_filters('bestof_widget_term_args', $term_args);
157
+
158
+		if (is_tax()) {
159
+			$taxonomy = get_query_var('taxonomy');
160
+			$cur_term = get_query_var('term');
161
+			$term_data = get_term_by('name', $cur_term, $taxonomy);
162
+			$term_args['parent'] = $term_data->term_id;
163
+		}
164
+
165
+		$terms = get_terms($category_taxonomy[0], $term_args);
166
+
167
+		$term_reviews = geodir_count_reviews_by_terms();
168
+		$a_terms = array();
169
+		foreach ($terms as $term) {
170
+
171
+
172
+			if ($term->count > 0) {
173
+				if (isset($term_reviews[$term->term_id])) {
174
+					$term->review_count = $term_reviews[$term->term_id];
175
+				} else {
176
+					$term->review_count = '0';
177
+				}
178
+
179
+				$a_terms[] = $term;
180
+			}
181
+
182
+		}
183
+
184
+
185
+		$terms = apply_filters('bestof_widget_sort_terms', geodir_sort_terms($a_terms, 'review_count'), $a_terms);
186
+
187
+		$query_args = array(
188
+			'posts_per_page' => $post_limit,
189
+			'is_geodir_loop' => true,
190
+			'post_type' => $post_type,
191
+			'gd_location' => $add_location_filter ? true : false,
192
+			'order_by' => 'high_review'
193
+		);
194
+		if ($character_count >= 0) {
195
+			$query_args['excerpt_length'] = $character_count;
196
+		}
197
+
198
+		$layout = array();
199
+		if ($tab_layout == 'bestof-tabs-as-dropdown') {
200
+			$layout[] = $tab_layout;
201
+		} else {
202
+			$layout[] = 'bestof-tabs-as-dropdown';
203
+			$layout[] = $tab_layout;
204
+		}
205
+
206
+
207
+		echo $before_title . __($title,'geodirectory') . $after_title;
208
+
209
+		//term navigation - start
210
+		echo '<div class="geodir-tabs gd-bestof-tabs" id="gd-bestof-tabs" style="position:relative;">';
211
+
212
+		$final_html = '';
213
+		foreach ($layout as $tab_layout) {
214
+			$nav_html = '';
215
+			$is_dropdown = ($tab_layout == 'bestof-tabs-as-dropdown') ? true : false;
216
+
217
+			if ($is_dropdown) {
218
+				$nav_html .= '<select id="geodir_bestof_tab_dd" class="chosen_select" name="geodir_bestof_tab_dd" data-placeholder="' . esc_attr(__('Select Category', 'geodirectory')) . '">';
219
+			} else {
220
+				$nav_html .= '<dl class="geodir-tab-head geodir-bestof-cat-list">';
221
+				$nav_html .= '<dt></dt>';
222
+			}
223
+
224
+
225
+			$term_icon = geodir_get_term_icon();
226
+			$cat_count = 0;
227
+			if (!empty($terms)) {
228
+				foreach ($terms as $cat) {
229
+					$cat_count++;
230
+					if ($cat_count > $categ_limit) {
231
+						break;
232
+					}
233
+					if ($is_dropdown) {
234
+						$selected = ($cat_count == 1) ? 'selected="selected"' : '';
235
+						$nav_html .= '<option ' . $selected . ' value="' . $cat->term_id . '">' . geodir_ucwords($cat->name) . '</option>';
236
+					} else {
237
+						if ($cat_count == 1) {
238
+							$nav_html .= '<dd class="geodir-tab-active">';
239
+						} else {
240
+							$nav_html .= '<dd class="">';
241
+						}
242
+						$term_icon_url = !empty($term_icon) && isset($term_icon[$cat->term_id]) ? $term_icon[$cat->term_id] : '';
243
+						$nav_html .= '<a data-termid="' . $cat->term_id . '" href="' . get_term_link($cat, $cat->taxonomy) . '">';
244
+						$nav_html .= '<img alt="' . $cat->name . ' icon" class="bestof-cat-icon" src="' . $term_icon_url . '"/>';
245
+						$nav_html .= '<span>';
246
+						$nav_html .= geodir_ucwords($cat->name);
247
+						$nav_html .= '<small>';
248
+						if (isset($cat->review_count)) {
249
+							$num_reviews = $cat->review_count;
250
+							if ($num_reviews == 0) {
251
+								$reviews = __('No Reviews', 'geodirectory');
252
+							} elseif ($num_reviews > 1) {
253
+								$reviews = $num_reviews . __(' Reviews', 'geodirectory');
254
+							} else {
255
+								$reviews = __('1 Review', 'geodirectory');
256
+							}
257
+							$nav_html .= $reviews;
258
+						}
259
+						$nav_html .= '</small>';
260
+						$nav_html .= '</span>';
261
+						$nav_html .= '</a>';
262
+						$nav_html .= '</dd>';
263
+					}
264
+				}
265
+			}
266
+
267
+			if ($is_dropdown) {
268
+				$nav_html .= '</select>';
269
+			} else {
270
+				$nav_html .= '</dl>';
271
+			}
272
+			$final_html .= $nav_html;
273
+		}
274
+		if ($terms) {
275
+			echo $final_html;
276
+		}
277
+		echo '</div>';
278
+		//term navigation - end
279
+
280
+		//first term listings by default - start
281
+		$first_term = '';
282
+		if ($terms) {
283
+			$first_term = $terms[0];
284
+			$tax_query = array(
285
+				'taxonomy' => $category_taxonomy[0],
286
+				'field' => 'id',
287
+				'terms' => $first_term->term_id
288
+			);
289
+			$query_args['tax_query'] = array($tax_query);
290
+		}
291
+
292
+		?>
293 293
         <input type="hidden" id="bestof_widget_post_type" name="bestof_widget_post_type"
294 294
                value="<?php echo $post_type; ?>">
295 295
         <input type="hidden" id="bestof_widget_excerpt_type" name="bestof_widget_excerpt_type"
@@ -300,110 +300,110 @@  discard block
 block discarded – undo
300 300
                value="<?php echo $category_taxonomy[0]; ?>">
301 301
         <input type="hidden" id="bestof_widget_location_filter" name="bestof_widget_location_filter"
302 302
                value="<?php if ($add_location_filter) {
303
-                   echo 1;
304
-               } else {
305
-                   echo 0;
306
-               } ?>">
303
+				   echo 1;
304
+			   } else {
305
+				   echo 0;
306
+			   } ?>">
307 307
         <input type="hidden" id="bestof_widget_char_count" name="bestof_widget_char_count"
308 308
                value="<?php echo $character_count; ?>">
309 309
         <div class="geo-bestof-contentwrap geodir-tabs-content" style="position: relative; z-index: 0;">
310 310
             <p id="geodir-bestof-loading" class="geodir-bestof-loading"><i class="fa fa-cog fa-spin"></i></p>
311 311
             <?php
312
-            echo '<div id="geodir-bestof-places">';
313
-            if ($terms) {
314
-                $view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($first_term, $first_term->taxonomy));
315
-                /**
316
-                 * Filter the page link to view all lisitngs.
317
-                 *
318
-                 * @since 1.5.1
319
-                 *
320
-                 * @param array $view_all_link View all listings page link.
321
-                 * @param array $post_type The Post type.
322
-                 * @param array $first_term The category term object.
323
-                 */
324
-                $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $first_term);
325
-
326
-                echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $first_term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>';
327
-            }
328
-            if ($excerpt_type == 'show-reviews') {
329
-                add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
330
-            }
331
-            geodir_bestof_places_by_term($query_args);
332
-            if ($excerpt_type == 'show-reviews') {
333
-                remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
334
-            }
335
-            echo "</div>";
336
-            ?>
312
+			echo '<div id="geodir-bestof-places">';
313
+			if ($terms) {
314
+				$view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($first_term, $first_term->taxonomy));
315
+				/**
316
+				 * Filter the page link to view all lisitngs.
317
+				 *
318
+				 * @since 1.5.1
319
+				 *
320
+				 * @param array $view_all_link View all listings page link.
321
+				 * @param array $post_type The Post type.
322
+				 * @param array $first_term The category term object.
323
+				 */
324
+				$view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $first_term);
325
+
326
+				echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $first_term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>';
327
+			}
328
+			if ($excerpt_type == 'show-reviews') {
329
+				add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
330
+			}
331
+			geodir_bestof_places_by_term($query_args);
332
+			if ($excerpt_type == 'show-reviews') {
333
+				remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
334
+			}
335
+			echo "</div>";
336
+			?>
337 337
         </div>
338 338
         <?php //first term listings by default - end
339
-        ?>
339
+		?>
340 340
         <?php echo $after_widget;
341
-        echo "</div>";
342
-    }
343
-
344
-    /**
345
-     * Sanitize best of widget form values as they are saved.
346
-     *
347
-     * @since 1.3.9
348
-     * @since 1.5.1 Declare function public.
349
-     *
350
-     * @param array $new_instance Values just sent to be saved.
351
-     * @param array $old_instance Previously saved values from database.
352
-     *
353
-     * @return array Updated safe values to be saved.
354
-     */
355
-    public function update($new_instance, $old_instance)
356
-    {
357
-        $instance = $old_instance;
358
-        $instance['title'] = strip_tags($new_instance['title']);
359
-        $instance['post_type'] = strip_tags($new_instance['post_type']);
360
-        $instance['post_limit'] = strip_tags($new_instance['post_limit']);
361
-        $instance['categ_limit'] = strip_tags($new_instance['categ_limit']);
362
-        $instance['character_count'] = $new_instance['character_count'];
363
-        $instance['tab_layout'] = $new_instance['tab_layout'];
364
-        $instance['excerpt_type'] = $new_instance['excerpt_type'];
365
-        if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '')
366
-            $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']);
367
-        else
368
-            $instance['add_location_filter'] = '0';
369
-        $instance['use_viewing_post_type'] = isset($new_instance['use_viewing_post_type']) && $new_instance['use_viewing_post_type'] ? 1 : 0;
370
-        return $instance;
371
-    }
372
-
373
-    /**
374
-     * Back-end best of widget settings form.
375
-     *
376
-     * @since 1.3.9
377
-     * @since 1.5.1 Declare function public.
378
-     *
379
-     * @param array $instance Previously saved values from database.
380
-     */
381
-    public function form($instance)
382
-    {
383
-        $instance = wp_parse_args((array)$instance,
384
-            array(
385
-                'title' => '',
386
-                'post_type' => '',
387
-                'post_limit' => '5',
388
-                'categ_limit' => '3',
389
-                'character_count' => '20',
390
-                'add_location_filter' => '1',
391
-                'tab_layout' => 'bestof-tabs-on-top',
392
-                'excerpt_type' => 'show-desc',
393
-                'use_viewing_post_type' => ''
394
-            )
395
-        );
396
-        $title = strip_tags($instance['title']);
397
-        $post_type = strip_tags($instance['post_type']);
398
-        $post_limit = strip_tags($instance['post_limit']);
399
-        $categ_limit = strip_tags($instance['categ_limit']);
400
-        $character_count = strip_tags($instance['character_count']);
401
-        $tab_layout = strip_tags($instance['tab_layout']);
402
-        $excerpt_type = strip_tags($instance['excerpt_type']);
403
-        $add_location_filter = strip_tags($instance['add_location_filter']);
404
-        $use_viewing_post_type = isset($instance['use_viewing_post_type']) && $instance['use_viewing_post_type'] ? true : false;
405
-
406
-        ?>
341
+		echo "</div>";
342
+	}
343
+
344
+	/**
345
+	 * Sanitize best of widget form values as they are saved.
346
+	 *
347
+	 * @since 1.3.9
348
+	 * @since 1.5.1 Declare function public.
349
+	 *
350
+	 * @param array $new_instance Values just sent to be saved.
351
+	 * @param array $old_instance Previously saved values from database.
352
+	 *
353
+	 * @return array Updated safe values to be saved.
354
+	 */
355
+	public function update($new_instance, $old_instance)
356
+	{
357
+		$instance = $old_instance;
358
+		$instance['title'] = strip_tags($new_instance['title']);
359
+		$instance['post_type'] = strip_tags($new_instance['post_type']);
360
+		$instance['post_limit'] = strip_tags($new_instance['post_limit']);
361
+		$instance['categ_limit'] = strip_tags($new_instance['categ_limit']);
362
+		$instance['character_count'] = $new_instance['character_count'];
363
+		$instance['tab_layout'] = $new_instance['tab_layout'];
364
+		$instance['excerpt_type'] = $new_instance['excerpt_type'];
365
+		if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '')
366
+			$instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']);
367
+		else
368
+			$instance['add_location_filter'] = '0';
369
+		$instance['use_viewing_post_type'] = isset($new_instance['use_viewing_post_type']) && $new_instance['use_viewing_post_type'] ? 1 : 0;
370
+		return $instance;
371
+	}
372
+
373
+	/**
374
+	 * Back-end best of widget settings form.
375
+	 *
376
+	 * @since 1.3.9
377
+	 * @since 1.5.1 Declare function public.
378
+	 *
379
+	 * @param array $instance Previously saved values from database.
380
+	 */
381
+	public function form($instance)
382
+	{
383
+		$instance = wp_parse_args((array)$instance,
384
+			array(
385
+				'title' => '',
386
+				'post_type' => '',
387
+				'post_limit' => '5',
388
+				'categ_limit' => '3',
389
+				'character_count' => '20',
390
+				'add_location_filter' => '1',
391
+				'tab_layout' => 'bestof-tabs-on-top',
392
+				'excerpt_type' => 'show-desc',
393
+				'use_viewing_post_type' => ''
394
+			)
395
+		);
396
+		$title = strip_tags($instance['title']);
397
+		$post_type = strip_tags($instance['post_type']);
398
+		$post_limit = strip_tags($instance['post_limit']);
399
+		$categ_limit = strip_tags($instance['categ_limit']);
400
+		$character_count = strip_tags($instance['character_count']);
401
+		$tab_layout = strip_tags($instance['tab_layout']);
402
+		$excerpt_type = strip_tags($instance['excerpt_type']);
403
+		$add_location_filter = strip_tags($instance['add_location_filter']);
404
+		$use_viewing_post_type = isset($instance['use_viewing_post_type']) && $instance['use_viewing_post_type'] ? true : false;
405
+
406
+		?>
407 407
         <p>
408 408
             <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?>
409 409
 
@@ -418,14 +418,14 @@  discard block
 block discarded – undo
418 418
                 for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory');?>
419 419
 
420 420
                 <?php $postypes = geodir_get_posttypes();
421
-                /**
422
-                 * Filter the post types to display in widget.
423
-                 *
424
-                 * @since 1.3.9
425
-                 *
426
-                 * @param array $postypes Post types array.
427
-                 */
428
-                $postypes = apply_filters('geodir_post_type_list_in_p_widget', $postypes); ?>
421
+				/**
422
+				 * Filter the post types to display in widget.
423
+				 *
424
+				 * @since 1.3.9
425
+				 *
426
+				 * @param array $postypes Post types array.
427
+				 */
428
+				$postypes = apply_filters('geodir_post_type_list_in_p_widget', $postypes); ?>
429 429
 
430 430
                 <select class="widefat" id="<?php echo $this->get_field_id('post_type'); ?>"
431 431
                         name="<?php echo $this->get_field_name('post_type'); ?>"
@@ -434,9 +434,9 @@  discard block
 block discarded – undo
434 434
                     <?php foreach ($postypes as $postypes_obj) { ?>
435 435
 
436 436
                         <option <?php if ($post_type == $postypes_obj) {
437
-                            echo 'selected="selected"';
438
-                        } ?> value="<?php echo $postypes_obj; ?>"><?php $extvalue = explode('_', $postypes_obj);
439
-                            echo ucfirst($extvalue[1]); ?></option>
437
+							echo 'selected="selected"';
438
+						} ?> value="<?php echo $postypes_obj; ?>"><?php $extvalue = explode('_', $postypes_obj);
439
+							echo ucfirst($extvalue[1]); ?></option>
440 440
 
441 441
                     <?php } ?>
442 442
 
@@ -482,14 +482,14 @@  discard block
 block discarded – undo
482 482
                         name="<?php echo $this->get_field_name('tab_layout'); ?>">
483 483
 
484 484
                     <option <?php if ($tab_layout == 'bestof-tabs-on-top') {
485
-                        echo 'selected="selected"';
486
-                    } ?> value="bestof-tabs-on-top"><?php _e('Tabs on Top', 'geodirectory'); ?></option>
485
+						echo 'selected="selected"';
486
+					} ?> value="bestof-tabs-on-top"><?php _e('Tabs on Top', 'geodirectory'); ?></option>
487 487
                     <option <?php if ($tab_layout == 'bestof-tabs-on-left') {
488
-                        echo 'selected="selected"';
489
-                    } ?> value="bestof-tabs-on-left"><?php _e('Tabs on Left', 'geodirectory'); ?></option>
488
+						echo 'selected="selected"';
489
+					} ?> value="bestof-tabs-on-left"><?php _e('Tabs on Left', 'geodirectory'); ?></option>
490 490
                     <option <?php if ($tab_layout == 'bestof-tabs-as-dropdown') {
491
-                        echo 'selected="selected"';
492
-                    } ?>
491
+						echo 'selected="selected"';
492
+					} ?>
493 493
                         value="bestof-tabs-as-dropdown"><?php _e('Tabs as Dropdown', 'geodirectory'); ?></option>
494 494
                 </select>
495 495
             </label>
@@ -503,11 +503,11 @@  discard block
 block discarded – undo
503 503
                         name="<?php echo $this->get_field_name('excerpt_type'); ?>">
504 504
 
505 505
                     <option <?php if ($excerpt_type == 'show-desc') {
506
-                        echo 'selected="selected"';
507
-                    } ?> value="show-desc"><?php _e('Show Description', 'geodirectory'); ?></option>
506
+						echo 'selected="selected"';
507
+					} ?> value="show-desc"><?php _e('Show Description', 'geodirectory'); ?></option>
508 508
                     <option <?php if ($excerpt_type == 'show-reviews') {
509
-                        echo 'selected="selected"';
510
-                    } ?> value="show-reviews"><?php _e('Show Reviews if Available', 'geodirectory'); ?></option>
509
+						echo 'selected="selected"';
510
+					} ?> value="show-reviews"><?php _e('Show Reviews if Available', 'geodirectory'); ?></option>
511 511
                 </select>
512 512
             </label>
513 513
         </p>
@@ -526,12 +526,12 @@  discard block
 block discarded – undo
526 526
                 for="<?php echo $this->get_field_id('use_viewing_post_type'); ?>"><?php _e('Use current viewing post type:', 'geodirectory'); ?>
527 527
                 <input type="checkbox" id="<?php echo $this->get_field_id('use_viewing_post_type'); ?>"
528 528
                        name="<?php echo $this->get_field_name('use_viewing_post_type'); ?>" <?php if ($use_viewing_post_type) {
529
-                    echo 'checked="checked"';
530
-                } ?>  value="1"/>
529
+					echo 'checked="checked"';
530
+				} ?>  value="1"/>
531 531
             </label>
532 532
         </p>
533 533
     <?php
534
-    }
534
+	}
535 535
 } // class geodir_bestof_widget
536 536
 
537 537
 register_widget('geodir_bestof_widget');
@@ -551,68 +551,68 @@  discard block
 block discarded – undo
551 551
  */
552 552
 function geodir_bestof_places_by_term($query_args)
553 553
 {
554
-    global $gd_session;
555
-
556
-    /**
557
-     * This action called before querying widget listings.
558
-     *
559
-     * @since 1.0.0
560
-     */
561
-    do_action('geodir_bestof_get_widget_listings_before');
562
-
563
-    $widget_listings = geodir_get_widget_listings($query_args);
564
-
565
-    /**
566
-     * This action called after querying widget listings.
567
-     *
568
-     * @since 1.0.0
569
-     */
570
-    do_action('geodir_bestof_get_widget_listings_after');
571
-
572
-    $character_count = isset($query_args['excerpt_length']) ? $query_args['excerpt_length'] : '';
573
-
574
-    if (!isset($character_count)) {
575
-        /** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */
576
-        $character_count = $character_count == '' ? 50 : apply_filters('bestof_widget_character_count', $character_count);
577
-    }
578
-
579
-    /** This filter is documented in geodirectory-functions/general_functions.php */
580
-    $template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview'));
581
-
582
-    global $post, $map_jason, $map_canvas_arr, $gridview_columns_widget, $geodir_is_widget_listing;
583
-    $current_post = $post;
584
-    $current_map_jason = $map_jason;
585
-    $current_map_canvas_arr = $map_canvas_arr;
586
-    $current_grid_view = $gridview_columns_widget;
587
-    $gridview_columns_widget = null;
588
-
589
-    $gd_listing_view_set = $gd_session->get('gd_listing_view') ? true : false;
590
-    $gd_listing_view_old = $gd_listing_view_set ? $gd_session->get('gd_listing_view') : '';
591
-
592
-    $gd_session->set('gd_listing_view', '1');
593
-    $geodir_is_widget_listing = true;
594
-
595
-    /**
596
-     * Includes the template for the listing listview.
597
-     *
598
-     * @since 1.3.9
599
-     */
600
-    include($template);
601
-
602
-    $geodir_is_widget_listing = false;
603
-
604
-    $GLOBALS['post'] = $current_post;
605
-    if (!empty($current_post)) {
606
-        setup_postdata($current_post);
607
-    }
608
-    if ($gd_listing_view_set) { // Set back previous value
609
-        $gd_session->set('gd_listing_view', $gd_listing_view_old);
610
-    } else {
611
-        $gd_session->un_set('gd_listing_view');
612
-    }
613
-    $map_jason = $current_map_jason;
614
-    $map_canvas_arr = $current_map_canvas_arr;
615
-    $gridview_columns_widget = $current_grid_view;
554
+	global $gd_session;
555
+
556
+	/**
557
+	 * This action called before querying widget listings.
558
+	 *
559
+	 * @since 1.0.0
560
+	 */
561
+	do_action('geodir_bestof_get_widget_listings_before');
562
+
563
+	$widget_listings = geodir_get_widget_listings($query_args);
564
+
565
+	/**
566
+	 * This action called after querying widget listings.
567
+	 *
568
+	 * @since 1.0.0
569
+	 */
570
+	do_action('geodir_bestof_get_widget_listings_after');
571
+
572
+	$character_count = isset($query_args['excerpt_length']) ? $query_args['excerpt_length'] : '';
573
+
574
+	if (!isset($character_count)) {
575
+		/** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */
576
+		$character_count = $character_count == '' ? 50 : apply_filters('bestof_widget_character_count', $character_count);
577
+	}
578
+
579
+	/** This filter is documented in geodirectory-functions/general_functions.php */
580
+	$template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview'));
581
+
582
+	global $post, $map_jason, $map_canvas_arr, $gridview_columns_widget, $geodir_is_widget_listing;
583
+	$current_post = $post;
584
+	$current_map_jason = $map_jason;
585
+	$current_map_canvas_arr = $map_canvas_arr;
586
+	$current_grid_view = $gridview_columns_widget;
587
+	$gridview_columns_widget = null;
588
+
589
+	$gd_listing_view_set = $gd_session->get('gd_listing_view') ? true : false;
590
+	$gd_listing_view_old = $gd_listing_view_set ? $gd_session->get('gd_listing_view') : '';
591
+
592
+	$gd_session->set('gd_listing_view', '1');
593
+	$geodir_is_widget_listing = true;
594
+
595
+	/**
596
+	 * Includes the template for the listing listview.
597
+	 *
598
+	 * @since 1.3.9
599
+	 */
600
+	include($template);
601
+
602
+	$geodir_is_widget_listing = false;
603
+
604
+	$GLOBALS['post'] = $current_post;
605
+	if (!empty($current_post)) {
606
+		setup_postdata($current_post);
607
+	}
608
+	if ($gd_listing_view_set) { // Set back previous value
609
+		$gd_session->set('gd_listing_view', $gd_listing_view_old);
610
+	} else {
611
+		$gd_session->un_set('gd_listing_view');
612
+	}
613
+	$map_jason = $current_map_jason;
614
+	$map_canvas_arr = $current_map_canvas_arr;
615
+	$gridview_columns_widget = $current_grid_view;
616 616
 }
617 617
 
618 618
 //Ajax functions
@@ -629,51 +629,51 @@  discard block
 block discarded – undo
629 629
  */
630 630
 function geodir_bestof_callback()
631 631
 {
632
-    check_ajax_referer('geodir-bestof-nonce', 'geodir_bestof_nonce');
633
-    //set variables
634
-    $post_type = strip_tags(esc_sql($_POST['post_type']));
635
-    $post_limit = strip_tags(esc_sql($_POST['post_limit']));
636
-    $character_count = strip_tags(esc_sql($_POST['char_count']));
637
-    $taxonomy = strip_tags(esc_sql($_POST['taxonomy']));
638
-    $add_location_filter = strip_tags(esc_sql($_POST['add_location_filter']));
639
-    $term_id = strip_tags(esc_sql($_POST['term_id']));
640
-    $excerpt_type = strip_tags(esc_sql($_POST['excerpt_type']));
641
-
642
-    $query_args = array(
643
-        'posts_per_page' => $post_limit,
644
-        'is_geodir_loop' => true,
645
-        'post_type' => $post_type,
646
-        'gd_location' => $add_location_filter ? true : false,
647
-        'order_by' => 'high_review'
648
-    );
649
-
650
-    if ($character_count >= 0) {
651
-        $query_args['excerpt_length'] = $character_count;
652
-    }
653
-
654
-    $tax_query = array(
655
-        'taxonomy' => $taxonomy,
656
-        'field' => 'id',
657
-        'terms' => $term_id
658
-    );
659
-
660
-    $query_args['tax_query'] = array($tax_query);
661
-    if ($term_id && $taxonomy) {
662
-        $term = get_term_by('id', $term_id, $taxonomy);
663
-        $view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($term));
664
-        /** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */
665
-        $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $term);
666
-
667
-        echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>';
668
-    }
669
-    if ($excerpt_type == 'show-reviews') {
670
-        add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
671
-    }
672
-    geodir_bestof_places_by_term($query_args);
673
-    if ($excerpt_type == 'show-reviews') {
674
-        remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
675
-    }
676
-    gd_die();
632
+	check_ajax_referer('geodir-bestof-nonce', 'geodir_bestof_nonce');
633
+	//set variables
634
+	$post_type = strip_tags(esc_sql($_POST['post_type']));
635
+	$post_limit = strip_tags(esc_sql($_POST['post_limit']));
636
+	$character_count = strip_tags(esc_sql($_POST['char_count']));
637
+	$taxonomy = strip_tags(esc_sql($_POST['taxonomy']));
638
+	$add_location_filter = strip_tags(esc_sql($_POST['add_location_filter']));
639
+	$term_id = strip_tags(esc_sql($_POST['term_id']));
640
+	$excerpt_type = strip_tags(esc_sql($_POST['excerpt_type']));
641
+
642
+	$query_args = array(
643
+		'posts_per_page' => $post_limit,
644
+		'is_geodir_loop' => true,
645
+		'post_type' => $post_type,
646
+		'gd_location' => $add_location_filter ? true : false,
647
+		'order_by' => 'high_review'
648
+	);
649
+
650
+	if ($character_count >= 0) {
651
+		$query_args['excerpt_length'] = $character_count;
652
+	}
653
+
654
+	$tax_query = array(
655
+		'taxonomy' => $taxonomy,
656
+		'field' => 'id',
657
+		'terms' => $term_id
658
+	);
659
+
660
+	$query_args['tax_query'] = array($tax_query);
661
+	if ($term_id && $taxonomy) {
662
+		$term = get_term_by('id', $term_id, $taxonomy);
663
+		$view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($term));
664
+		/** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */
665
+		$view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $term);
666
+
667
+		echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>';
668
+	}
669
+	if ($excerpt_type == 'show-reviews') {
670
+		add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
671
+	}
672
+	geodir_bestof_places_by_term($query_args);
673
+	if ($excerpt_type == 'show-reviews') {
674
+		remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
675
+	}
676
+	gd_die();
677 677
 }
678 678
 
679 679
 //Javascript
@@ -686,8 +686,8 @@  discard block
 block discarded – undo
686 686
  */
687 687
 function geodir_bestof_js()
688 688
 {
689
-    $ajax_nonce = wp_create_nonce("geodir-bestof-nonce");
690
-    ?>
689
+	$ajax_nonce = wp_create_nonce("geodir-bestof-nonce");
690
+	?>
691 691
     <script type="text/javascript">
692 692
         jQuery(document).ready(function () {
693 693
             jQuery('.geodir-bestof-cat-list a, #geodir_bestof_tab_dd').on("click change", function (e) {
@@ -766,18 +766,18 @@  discard block
 block discarded – undo
766 766
 
767 767
 function best_of_show_review_in_excerpt($excerpt)
768 768
 {
769
-    global $wpdb, $post;
770
-    $review_table = GEODIR_REVIEW_TABLE;
771
-    $request = "SELECT comment_ID FROM $review_table WHERE post_id = $post->ID ORDER BY post_date DESC, id DESC LIMIT 1";
772
-    $comments = $wpdb->get_results($request);
773
-
774
-    if ($comments) {
775
-        foreach ($comments as $comment) {
776
-            // Set the extra comment info needed.
777
-            $comment_extra = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID");
778
-            $comment_content = $comment_extra->comment_content;
779
-            $excerpt = strip_tags($comment_content);
780
-        }
781
-    }
782
-    return $excerpt;
769
+	global $wpdb, $post;
770
+	$review_table = GEODIR_REVIEW_TABLE;
771
+	$request = "SELECT comment_ID FROM $review_table WHERE post_id = $post->ID ORDER BY post_date DESC, id DESC LIMIT 1";
772
+	$comments = $wpdb->get_results($request);
773
+
774
+	if ($comments) {
775
+		foreach ($comments as $comment) {
776
+			// Set the extra comment info needed.
777
+			$comment_extra = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID");
778
+			$comment_content = $comment_extra->comment_content;
779
+			$excerpt = strip_tags($comment_content);
780
+		}
781
+	}
782
+	return $excerpt;
783 783
 }
784 784
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory_template_actions.php 3 patches
Braces   +31 added lines, -24 removed lines patch added patch discarded remove patch
@@ -714,8 +714,9 @@  discard block
 block discarded – undo
714 714
 
715 715
                         if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
716 716
                             if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
717
-                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
718
-                                    $term_icon = $term_icon_url['src'];
717
+                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') {
718
+                                                                    $term_icon = $term_icon_url['src'];
719
+                                }
719 720
                                 break;
720 721
                             }
721 722
                         }
@@ -1246,8 +1247,9 @@  discard block
 block discarded – undo
1246 1247
         echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1247 1248
     }
1248 1249
 
1249
-    if (isset($taxonomies[$post_type . '_tags']))
1250
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1250
+    if (isset($taxonomies[$post_type . '_tags'])) {
1251
+            echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1252
+    }
1251 1253
 
1252 1254
     ?>
1253 1255
     </p><?php
@@ -1598,23 +1600,21 @@  discard block
 block discarded – undo
1598 1600
     if(geodir_is_page('pt')){
1599 1601
         $gd_page = 'pt';
1600 1602
         $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1601
-    }
1602
-    elseif(geodir_is_page('listing')){
1603
+    } elseif(geodir_is_page('listing')){
1603 1604
         $gd_page = 'listing';
1604 1605
         global $wp_query;
1605 1606
         $current_term = $wp_query->get_queried_object();
1606 1607
         if (strpos($current_term->taxonomy,'_tags') !== false) {
1607 1608
             $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1608
-        }else{
1609
+        } else{
1609 1610
             $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1610 1611
         }
1611 1612
 
1612
-    }
1613
-    elseif(geodir_is_page('author')){
1613
+    } elseif(geodir_is_page('author')){
1614 1614
         $gd_page = 'author';
1615 1615
         if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1616 1616
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1617
-        }else{
1617
+        } else{
1618 1618
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1619 1619
         }
1620 1620
 
@@ -2025,8 +2025,9 @@  discard block
 block discarded – undo
2025 2025
  */
2026 2026
 function geodir_action_add_listing_page_title()
2027 2027
 {
2028
-    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2029
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2028
+    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') {
2029
+            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2030
+    }
2030 2031
     /** This action is documented in geodirectory_template_actions.php */
2031 2032
     $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2032 2033
     /** This action is documented in geodirectory_template_actions.php */
@@ -2038,7 +2039,7 @@  discard block
 block discarded – undo
2038 2039
         $gd_page = 'add-listing';
2039 2040
         if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2040 2041
             $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2041
-        }elseif(isset($listing_type)){
2042
+        } elseif(isset($listing_type)){
2042 2043
             $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2043 2044
         }
2044 2045
 
@@ -2321,8 +2322,9 @@  discard block
 block discarded – undo
2321 2322
         $totImg = 0;
2322 2323
         if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2323 2324
             $post = (object)$gd_session->get('listing');
2324
-            if (isset($post->post_images))
2325
-                $curImages = trim($post->post_images, ",");
2325
+            if (isset($post->post_images)) {
2326
+                            $curImages = trim($post->post_images, ",");
2327
+            }
2326 2328
 
2327 2329
 
2328 2330
             if ($curImages != '') {
@@ -2350,10 +2352,13 @@  discard block
 block discarded – undo
2350 2352
             $totImg = count((array)$thumb_img_arr);
2351 2353
         }
2352 2354
 
2353
-        if ($curImages != '')
2354
-            $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2355
-        else
2356
-            $svalue = '';
2355
+        if ($curImages != '') {
2356
+                    $svalue = $curImages;
2357
+        }
2358
+        // this will be initial value of the above form field. Image urls.
2359
+        else {
2360
+                    $svalue = '';
2361
+        }
2357 2362
 
2358 2363
         $image_limit = $package_info->image_limit;
2359 2364
         $show_image_input_box = ($image_limit != '0');
@@ -2563,8 +2568,9 @@  discard block
 block discarded – undo
2563 2568
     </script><?php
2564 2569
 
2565 2570
     global $errors;
2566
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2567
-        $errors->add('claim_login', LOGIN_CLAIM);
2571
+    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') {
2572
+            $errors->add('claim_login', LOGIN_CLAIM);
2573
+    }
2568 2574
 
2569 2575
     if (!empty($errors)) {
2570 2576
         foreach ($errors as $errorsObj) {
@@ -2668,8 +2674,9 @@  discard block
 block discarded – undo
2668 2674
 
2669 2675
     if (!empty($term)) {
2670 2676
         $current_term = get_term_by('slug', $term, $taxonomy[0]);
2671
-        if (!empty($current_term))
2672
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2677
+        if (!empty($current_term)) {
2678
+                    $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2679
+        }
2673 2680
     }
2674 2681
 
2675 2682
 
@@ -2687,7 +2694,7 @@  discard block
 block discarded – undo
2687 2694
         $gd_page = 'author';
2688 2695
         if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2689 2696
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2690
-        }else{
2697
+        } else{
2691 2698
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2692 2699
         }
2693 2700
 
Please login to merge, or discard this patch.
Spacing   +164 added lines, -164 removed lines patch added patch discarded remove patch
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 
284 284
     //php
285 285
     if (!empty($tc['geodir_theme_compat_code'])) {
286
-        include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
286
+        include_once('geodirectory-functions/compatibility/'.$tc['geodir_theme_compat_code'].'.php');
287 287
     }
288 288
 
289 289
     //geodir_full_page_class
@@ -453,13 +453,13 @@  discard block
 block discarded – undo
453 453
 function geodir_action_wrapper_content_open($type = '', $id = '', $class = '')
454 454
 {
455 455
     if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
456
-        $width_css = 'style="width:' . $width . '%;"';
456
+        $width_css = 'style="width:'.$width.'%;"';
457 457
     } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
458
-        $width_css = 'style="width:' . $width . '%;"';
458
+        $width_css = 'style="width:'.$width.'%;"';
459 459
     } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
460
-        $width_css = 'style="width:' . $width . '%;"';
460
+        $width_css = 'style="width:'.$width.'%;"';
461 461
     } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
462
-        $width_css = 'style="width:' . $width . '%;"';
462
+        $width_css = 'style="width:'.$width.'%;"';
463 463
     } else {
464 464
         $width_css = '';
465 465
     }
@@ -573,13 +573,13 @@  discard block
 block discarded – undo
573 573
 function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
574 574
 {
575 575
     if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
576
-        $width_css = 'style="width:' . $width . '%;"';
576
+        $width_css = 'style="width:'.$width.'%;"';
577 577
     } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
578
-        $width_css = 'style="width:' . $width . '%;"';
578
+        $width_css = 'style="width:'.$width.'%;"';
579 579
     } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
580
-        $width_css = 'style="width:' . $width . '%;"';
580
+        $width_css = 'style="width:'.$width.'%;"';
581 581
     } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
582
-        $width_css = 'style="width:' . $width . '%;"';
582
+        $width_css = 'style="width:'.$width.'%;"';
583 583
     } else {
584 584
         $width_css = '';
585 585
     }
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
         }
678 678
     }
679 679
 
680
-    $post = (object)$_REQUEST;
680
+    $post = (object) $_REQUEST;
681 681
 
682 682
 
683 683
     if (isset($post->video)) {
@@ -736,10 +736,10 @@  discard block
 block discarded – undo
736 736
 
737 737
     $json = '{';
738 738
     $json .= '"post_preview": "1",';
739
-    $json .= '"t": "' . $json_title . '",';
740
-    $json .= '"lt": "' . $post_latitude . '",';
741
-    $json .= '"ln": "' . $post_longitude . '",';
742
-    $json .= '"i":"' . $term_icon . '"';
739
+    $json .= '"t": "'.$json_title.'",';
740
+    $json .= '"lt": "'.$post_latitude.'",';
741
+    $json .= '"ln": "'.$post_longitude.'",';
742
+    $json .= '"i":"'.$term_icon.'"';
743 743
     $json .= '}';
744 744
 
745 745
     $post->marker_json = $json;
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
      * @param string $class The class to use. Default is 'entry-header'.
967 967
      */
968 968
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
969
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
969
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.stripslashes(get_the_title()).'</h1></header>';
970 970
 }
971 971
 
972 972
 
@@ -1020,7 +1020,7 @@  discard block
 block discarded – undo
1020 1020
                     $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1021 1021
 
1022 1022
                     if ($image && $width && $height) {
1023
-                        $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1023
+                        $image = (object) array('src' => $image, 'width' => $width, 'height' => $height);
1024 1024
                     }
1025 1025
 
1026 1026
                     if (isset($image->src)) {
@@ -1032,9 +1032,9 @@  discard block
 block discarded – undo
1032 1032
 
1033 1033
                         $image_title = isset($image->title) ? $image->title : '';
1034 1034
 
1035
-                        $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1036
-                        $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1037
-                        $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1035
+                        $main_slides .= '<li><img src="'.geodir_plugin_url()."/geodirectory-assets/images/spacer.gif".'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:'.$spacer_height.'px;margin:0 auto;" />';
1036
+                        $main_slides .= '<img src="'.$image->src.'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:400px;margin:0 auto;" /></li>';
1037
+                        $nav_slides .= '<li><img src="'.$image->src.'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:48px;margin:0 auto;" /></li>';
1038 1038
                         $slides++;
1039 1039
                     }
1040 1040
                 }
@@ -1053,10 +1053,10 @@  discard block
 block discarded – undo
1053 1053
                 } else {
1054 1054
                     $spacer_height = ((400 - $image->height) / 2);
1055 1055
                 }
1056
-                $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1057
-                $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1058
-                $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1059
-                $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1056
+                $caption = ''; //(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1057
+                $main_slides .= '<li><img src="'.geodir_plugin_url()."/geodirectory-assets/images/spacer.gif".'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:'.$spacer_height.'px;margin:0 auto;" />';
1058
+                $main_slides .= '<img src="'.$image->src.'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1059
+                $nav_slides .= '<li><img src="'.$image->src.'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:48px;margin:0 auto;" /></li>';
1060 1060
                 $slides++;
1061 1061
             }
1062 1062
         }// endfore
@@ -1091,7 +1091,7 @@  discard block
 block discarded – undo
1091 1091
  */
1092 1092
 function geodir_action_details_taxonomies()
1093 1093
 {
1094
-    global $preview, $post;?>
1094
+    global $preview, $post; ?>
1095 1095
     <p class="geodir_post_taxomomies clearfix">
1096 1096
     <?php
1097 1097
     $taxonomies = array();
@@ -1100,11 +1100,11 @@  discard block
 block discarded – undo
1100 1100
 
1101 1101
     if ($preview && !$is_backend_preview) {
1102 1102
         $post_type = $post->listing_type;
1103
-        $post_taxonomy = $post_type . 'category';
1103
+        $post_taxonomy = $post_type.'category';
1104 1104
         $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1105 1105
     } else {
1106 1106
         $post_type = $post->post_type;
1107
-        $post_taxonomy = $post_type . 'category';
1107
+        $post_taxonomy = $post_type.'category';
1108 1108
     }
1109 1109
 //{	
1110 1110
     $post_type_info = get_post_type_object($post_type);
@@ -1112,7 +1112,7 @@  discard block
 block discarded – undo
1112 1112
 
1113 1113
     if (!empty($post->post_tags)) {
1114 1114
 
1115
-        if (taxonomy_exists($post_type . '_tags')):
1115
+        if (taxonomy_exists($post_type.'_tags')):
1116 1116
             $links = array();
1117 1117
             $terms = array();
1118 1118
             // to limit post tags
@@ -1139,8 +1139,8 @@  discard block
 block discarded – undo
1139 1139
                 $post_term = trim($post_term);
1140 1140
 
1141 1141
                 $priority_location = false;
1142
-                if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1143
-                    $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1142
+                if ($insert_term = term_exists($post_term, $post_type.'_tags')) {
1143
+                    $term = get_term_by('id', $insert_term['term_id'], $post_type.'_tags');
1144 1144
                 } else {
1145 1145
                     $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1146 1146
                     $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
@@ -1150,10 +1150,10 @@  discard block
 block discarded – undo
1150 1150
                     $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1151 1151
                     if ($match_country || $match_region || $match_city) {
1152 1152
                         $priority_location = true;
1153
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1153
+                        $term = get_term_by('name', $post_term, $post_type.'_tags');
1154 1154
                     } else {
1155
-                        $insert_term = wp_insert_term($post_term, $post_type . '_tags');
1156
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1155
+                        $insert_term = wp_insert_term($post_term, $post_type.'_tags');
1156
+                        $term = get_term_by('name', $post_term, $post_type.'_tags');
1157 1157
                     }
1158 1158
                 }
1159 1159
 
@@ -1170,12 +1170,12 @@  discard block
 block discarded – undo
1170 1170
                          * @param string $tag_link The tag link html.
1171 1171
                          * @param object $term The tag term object.
1172 1172
                          */
1173
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1173
+                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
1174 1174
                         $links[] = $tag_link;
1175 1175
                     } else {
1176
-                        $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1176
+                        $tag_link = "<a href='".esc_attr(get_term_link($term->term_id, $term->taxonomy))."'>$term->name</a>";
1177 1177
                         /** This action is documented in geodirectory-template_actions.php */
1178
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1178
+                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
1179 1179
                         $links[] = $tag_link;
1180 1180
                     }
1181 1181
                     $terms[] = $term;
@@ -1185,7 +1185,7 @@  discard block
 block discarded – undo
1185 1185
             if (!isset($listing_label)) {
1186 1186
                 $listing_label = '';
1187 1187
             }
1188
-            $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1188
+            $taxonomies[$post_type.'_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms);
1189 1189
         endif;
1190 1190
 
1191 1191
     }
@@ -1213,7 +1213,7 @@  discard block
 block discarded – undo
1213 1213
                     $term = get_term_by('id', $post_term, $post_taxonomy);
1214 1214
 
1215 1215
                     if (is_object($term)) {
1216
-                        $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1216
+                        $term_link = "<a href='".esc_attr(get_term_link($term, $post_taxonomy))."'>$term->name</a>";
1217 1217
                         /**
1218 1218
                          * Filter the category name on the details page.
1219 1219
                          *
@@ -1221,7 +1221,7 @@  discard block
 block discarded – undo
1221 1221
                          * @param string $term_link The link html to the category.
1222 1222
                          * @param object $term The category term object.
1223 1223
                          */
1224
-                        $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1224
+                        $term_link = apply_filters('geodir_details_taxonomies_cat_link', $term_link, $term);
1225 1225
                         $links[] = $term_link;
1226 1226
                         $terms[] = $term;
1227 1227
                     }
@@ -1239,7 +1239,7 @@  discard block
 block discarded – undo
1239 1239
         if (!isset($listing_label)) {
1240 1240
             $listing_label = '';
1241 1241
         }
1242
-        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1242
+        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms);
1243 1243
 
1244 1244
     }
1245 1245
 
@@ -1252,14 +1252,14 @@  discard block
 block discarded – undo
1252 1252
      * @param string $listing_label The post type label.
1253 1253
      * @param string $listing_label The post type label with ucwords function.
1254 1254
      */
1255
-    $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1255
+    $taxonomies = apply_filters('geodir_details_taxonomies_output', $taxonomies, $post_type, $listing_label, geodir_ucwords($listing_label));
1256 1256
 
1257 1257
     if (isset($taxonomies[$post_taxonomy])) {
1258
-        echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1258
+        echo '<span class="geodir-category">'.$taxonomies[$post_taxonomy].'</span>';
1259 1259
     }
1260 1260
 
1261
-    if (isset($taxonomies[$post_type . '_tags']))
1262
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1261
+    if (isset($taxonomies[$post_type.'_tags']))
1262
+        echo '<span class="geodir-tags">'.$taxonomies[$post_type.'_tags'].'</span>';
1263 1263
 
1264 1264
     ?>
1265 1265
     </p><?php
@@ -1280,11 +1280,11 @@  discard block
 block discarded – undo
1280 1280
  * @param object $post Optional. The post object or blank.
1281 1281
  * @package GeoDirectory
1282 1282
  */
1283
-function geodir_action_details_micordata($post='')
1283
+function geodir_action_details_micordata($post = '')
1284 1284
 {
1285 1285
 
1286 1286
     global $preview;
1287
-    if(empty($post)){global $post;}
1287
+    if (empty($post)) {global $post; }
1288 1288
     if ($preview || !geodir_is_page('detail')) {
1289 1289
         return;
1290 1290
     }
@@ -1305,7 +1305,7 @@  discard block
 block discarded – undo
1305 1305
                 "description" => $review->comment_content,
1306 1306
                 "reviewRating" => array(
1307 1307
                     "@type" => "Rating",
1308
-                    "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1308
+                    "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1309 1309
                     "ratingValue" => geodir_get_commentoverall($review->comment_ID),
1310 1310
                     "worstRating" => "1"
1311 1311
                 )
@@ -1333,13 +1333,13 @@  discard block
 block discarded – undo
1333 1333
     }
1334 1334
     //print_r($post);
1335 1335
     // external links
1336
-    $external_links =  array();
1336
+    $external_links = array();
1337 1337
     $external_links[] = $post->geodir_website;
1338 1338
     $external_links[] = $post->geodir_twitter;
1339 1339
     $external_links[] = $post->geodir_facebook;
1340 1340
     $external_links = array_filter($external_links);
1341 1341
 
1342
-    if(!empty($external_links)){
1342
+    if (!empty($external_links)) {
1343 1343
         $external_links = array_values($external_links);
1344 1344
     }
1345 1345
 
@@ -1349,17 +1349,17 @@  discard block
 block discarded – undo
1349 1349
 
1350 1350
     // schema type
1351 1351
     $schema_type = 'LocalBusiness';
1352
-    if(isset($post->default_category) && $post->default_category){
1352
+    if (isset($post->default_category) && $post->default_category) {
1353 1353
         $cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1354
-        if($cat_schema){$schema_type = $cat_schema;}
1355
-        if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1354
+        if ($cat_schema) {$schema_type = $cat_schema; }
1355
+        if (!$schema_type && $post->post_type == 'gd_event') {$schema_type = 'Event'; }
1356 1356
     }
1357 1357
 
1358 1358
     $schema = array();
1359 1359
     $schema['@context'] = "https://schema.org";
1360 1360
     $schema['@type'] = $schema_type;
1361 1361
     $schema['name'] = $post->post_title;
1362
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1362
+    $schema['description'] = wp_strip_all_tags($post->post_content, true);
1363 1363
     $schema['telephone'] = $post->geodir_contact;
1364 1364
     $schema['url'] = $c_url;
1365 1365
     $schema['sameAs'] = $external_links;
@@ -1373,7 +1373,7 @@  discard block
 block discarded – undo
1373 1373
         "postalCode" => $post->post_zip
1374 1374
     );
1375 1375
 
1376
-    if($post->post_latitude && $post->post_longitude) {
1376
+    if ($post->post_latitude && $post->post_longitude) {
1377 1377
         $schema['geo'] = array(
1378 1378
             "@type" => "GeoCoordinates",
1379 1379
             "latitude" => $post->post_latitude,
@@ -1381,7 +1381,7 @@  discard block
 block discarded – undo
1381 1381
         );
1382 1382
     }
1383 1383
 
1384
-    if($post_avgratings) {
1384
+    if ($post_avgratings) {
1385 1385
         $schema['aggregateRating'] = array(
1386 1386
             "@type" => "AggregateRating",
1387 1387
             "ratingValue" => $post_avgratings,
@@ -1400,10 +1400,10 @@  discard block
 block discarded – undo
1400 1400
      * @param array $schema The array of schema data to be filtered.
1401 1401
      * @param object $post The post object.
1402 1402
      */
1403
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1403
+    $schema = apply_filters('geodir_details_schema', $schema, $post);
1404 1404
 
1405 1405
 
1406
-    echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1406
+    echo '<script type="application/ld+json">'.json_encode($schema).'</script>';
1407 1407
 
1408 1408
 
1409 1409
     $uploads = wp_upload_dir();
@@ -1416,7 +1416,7 @@  discard block
 block discarded – undo
1416 1416
      * @param string $facebook_og The open graph html to be filtered.
1417 1417
      * @param object $post The post object.
1418 1418
      */
1419
-    echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1419
+    echo apply_filters('geodir_details_facebook_og', $facebook_og, $post);
1420 1420
 
1421 1421
 
1422 1422
 
@@ -1439,9 +1439,9 @@  discard block
 block discarded – undo
1439 1439
     ?>
1440 1440
     <div class="geodir-pos_navigation clearfix">
1441 1441
     <div
1442
-        class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
1442
+        class="geodir-post_left"><?php previous_post_link('%link', ''.__('Previous', 'geodirectory'), false) ?></div>
1443 1443
     <div
1444
-        class="geodir-post_right"><?php next_post_link('%link', __('Next', 'geodirectory') . '', false) ?></div>
1444
+        class="geodir-post_right"><?php next_post_link('%link', __('Next', 'geodirectory').'', false) ?></div>
1445 1445
     </div><?php
1446 1446
 }
1447 1447
 
@@ -1510,12 +1510,12 @@  discard block
 block discarded – undo
1510 1510
     $gd_post_type = geodir_get_current_posttype();
1511 1511
     $post_type_info = get_post_type_object($gd_post_type);
1512 1512
 
1513
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
1513
+    $add_string_in_title = __('All', 'geodirectory').' ';
1514 1514
     if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1515
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1515
+        $add_string_in_title = __('My Favorite', 'geodirectory').' ';
1516 1516
     }
1517 1517
 
1518
-    $list_title = $add_string_in_title . __($post_type_info->labels->name, 'geodirectory');
1518
+    $list_title = $add_string_in_title.__($post_type_info->labels->name, 'geodirectory');
1519 1519
     $single_name = $post_type_info->labels->singular_name;
1520 1520
 
1521 1521
     $taxonomy = geodir_get_taxonomies($gd_post_type, true);
@@ -1543,12 +1543,12 @@  discard block
 block discarded – undo
1543 1543
         $current_term = get_term_by('slug', $term, $taxonomy[0]);
1544 1544
         if (!empty($current_term)) {
1545 1545
             $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1546
-            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1546
+            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type.'category') {
1547 1547
                 $location_last_char = substr($location_name, -1);
1548 1548
                 $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1549
-                $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1549
+                $list_title .= __(' in', 'geodirectory').' '.$location_name.$location_name_attach.' '.$current_term_name;
1550 1550
             } else {
1551
-                $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1551
+                $list_title .= __(' in', 'geodirectory')." '".$current_term_name."'";
1552 1552
             }
1553 1553
         } else {
1554 1554
             if (count($taxonomy) > 1) {
@@ -1556,12 +1556,12 @@  discard block
 block discarded – undo
1556 1556
 
1557 1557
                 if (!empty($current_term)) {
1558 1558
                     $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1559
-                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1559
+                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type.'category') {
1560 1560
                         $location_last_char = substr($location_name, -1);
1561 1561
                         $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1562
-                        $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1562
+                        $list_title .= __(' in', 'geodirectory').' '.$location_name.$location_name_attach.' '.$current_term_name;
1563 1563
                     } else {
1564
-                        $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1564
+                        $list_title .= __(' in', 'geodirectory')." '".$current_term_name."'";
1565 1565
                     }
1566 1566
                 }
1567 1567
             }
@@ -1589,7 +1589,7 @@  discard block
 block discarded – undo
1589 1589
                 $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1590 1590
             }
1591 1591
 
1592
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1592
+            $list_title .= __(' in', 'geodirectory')." '".$gd_city."'";
1593 1593
         } else if ($gd_region != '') {
1594 1594
             if ($gd_region_actual != '') {
1595 1595
                 $gd_region = $gd_region_actual;
@@ -1599,7 +1599,7 @@  discard block
 block discarded – undo
1599 1599
                 $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1600 1600
             }
1601 1601
 
1602
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1602
+            $list_title .= __(' in', 'geodirectory')." '".$gd_region."'";
1603 1603
         } else if ($gd_country != '') {
1604 1604
             if ($gd_country_actual != '') {
1605 1605
                 $gd_country = $gd_country_actual;
@@ -1609,12 +1609,12 @@  discard block
 block discarded – undo
1609 1609
                 $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1610 1610
             }
1611 1611
 
1612
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1612
+            $list_title .= __(' in', 'geodirectory')." '".$gd_country."'";
1613 1613
         }
1614 1614
     }
1615 1615
 
1616 1616
     if (is_search()) {
1617
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1617
+        $list_title = __('Search', 'geodirectory').' '.__(ucfirst($post_type_info->labels->name), 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
1618 1618
     }
1619 1619
     /** This action is documented in geodirectory_template_actions.php */
1620 1620
     $class = apply_filters('geodir_page_title_class', 'entry-title fn');
@@ -1624,26 +1624,26 @@  discard block
 block discarded – undo
1624 1624
 
1625 1625
     $title = $list_title;
1626 1626
     $gd_page = '';
1627
-    if(geodir_is_page('pt')){
1627
+    if (geodir_is_page('pt')) {
1628 1628
         $gd_page = 'pt';
1629
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1629
+        $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1630 1630
     }
1631
-    elseif(geodir_is_page('listing')){
1631
+    elseif (geodir_is_page('listing')) {
1632 1632
         $gd_page = 'listing';
1633 1633
         global $wp_query;
1634 1634
         $current_term = $wp_query->get_queried_object();
1635
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1635
+        if (strpos($current_term->taxonomy, '_tags') !== false) {
1636 1636
             $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1637
-        }else{
1637
+        } else {
1638 1638
             $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1639 1639
         }
1640 1640
 
1641 1641
     }
1642
-    elseif(geodir_is_page('author')){
1642
+    elseif (geodir_is_page('author')) {
1643 1643
         $gd_page = 'author';
1644
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1644
+        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1645 1645
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1646
-        }else{
1646
+        } else {
1647 1647
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1648 1648
         }
1649 1649
 
@@ -1657,16 +1657,16 @@  discard block
 block discarded – undo
1657 1657
      * @param string $title The page title including variables.
1658 1658
      * @param string $gd_page The GeoDirectory page type if any.
1659 1659
      */
1660
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1660
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1661 1661
 
1662
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1662
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.
1663 1663
         /**
1664 1664
          * Filter the listing page title.
1665 1665
          *
1666 1666
          * @since 1.0.0
1667 1667
          * @param string $list_title The title for the category page.
1668 1668
          */
1669
-        apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1669
+        apply_filters('geodir_listing_page_title', $title).'</h1></header>';
1670 1670
 }
1671 1671
 
1672 1672
 add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
@@ -1685,16 +1685,16 @@  discard block
 block discarded – undo
1685 1685
     $gd_post_type = geodir_get_current_posttype();
1686 1686
     if (isset($current_term->term_id) && $current_term->term_id != '') {
1687 1687
 
1688
-        $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1688
+        $term_desc = term_description($current_term->term_id, $gd_post_type.'_tags');
1689 1689
         $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1690 1690
         if ($term_desc && !$saved_data) {
1691 1691
             $saved_data = $term_desc;
1692 1692
         }
1693 1693
 
1694 1694
         // stop payment manager filtering content length
1695
-        $filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1696
-        if ( false !== $filter_priority ) {
1697
-            remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1695
+        $filter_priority = has_filter('the_content', 'geodir_payments_the_content');
1696
+        if (false !== $filter_priority) {
1697
+            remove_filter('the_content', 'geodir_payments_the_content', $filter_priority);
1698 1698
         }
1699 1699
 
1700 1700
         /**
@@ -1708,14 +1708,14 @@  discard block
 block discarded – undo
1708 1708
         $cat_description = apply_filters('the_content', $saved_data);
1709 1709
 
1710 1710
 
1711
-        if ( false !== $filter_priority ) {
1712
-            add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1711
+        if (false !== $filter_priority) {
1712
+            add_filter('the_content', 'geodir_payments_the_content', $filter_priority);
1713 1713
         }
1714 1714
 
1715 1715
         if ($cat_description) {
1716 1716
             ?>
1717 1717
 
1718
-            <div class="term_description"><?php echo $cat_description;?></div> <?php
1718
+            <div class="term_description"><?php echo $cat_description; ?></div> <?php
1719 1719
         }
1720 1720
 
1721 1721
     }
@@ -1765,13 +1765,13 @@  discard block
 block discarded – undo
1765 1765
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1766 1766
 {
1767 1767
     if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1768
-        $width_css = 'style="width:' . $width . '%;"';
1768
+        $width_css = 'style="width:'.$width.'%;"';
1769 1769
     } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1770
-        $width_css = 'style="width:' . $width . '%;"';
1770
+        $width_css = 'style="width:'.$width.'%;"';
1771 1771
     } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1772
-        $width_css = 'style="width:' . $width . '%;"';
1772
+        $width_css = 'style="width:'.$width.'%;"';
1773 1773
     } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1774
-        $width_css = 'style="width:' . $width . '%;"';
1774
+        $width_css = 'style="width:'.$width.'%;"';
1775 1775
     } else {
1776 1776
         $width_css = '';
1777 1777
     }
@@ -2076,11 +2076,11 @@  discard block
 block discarded – undo
2076 2076
 
2077 2077
     $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2078 2078
 
2079
-    if(geodir_is_page('add-listing')){
2079
+    if (geodir_is_page('add-listing')) {
2080 2080
         $gd_page = 'add-listing';
2081
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2081
+        if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2082 2082
             $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2083
-        }elseif(isset($listing_type)){
2083
+        }elseif (isset($listing_type)) {
2084 2084
             $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2085 2085
         }
2086 2086
 
@@ -2094,9 +2094,9 @@  discard block
 block discarded – undo
2094 2094
      * @param string $title The page title including variables.
2095 2095
      * @param string $gd_page The GeoDirectory page type if any.
2096 2096
      */
2097
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2097
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2098 2098
 
2099
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2099
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">';
2100 2100
     echo $title;
2101 2101
     echo '</h1></header>';
2102 2102
 }
@@ -2110,7 +2110,7 @@  discard block
 block discarded – undo
2110 2110
  */
2111 2111
 function geodir_action_add_listing_page_mandatory()
2112 2112
 {?>
2113
-    <p class="geodir-note "><span class="geodir-required">*</span>&nbsp;<?php echo INDICATES_MANDATORY_FIELDS_TEXT;?></p>
2113
+    <p class="geodir-note "><span class="geodir-required">*</span>&nbsp;<?php echo INDICATES_MANDATORY_FIELDS_TEXT; ?></p>
2114 2114
 <?php
2115 2115
 }
2116 2116
 
@@ -2145,7 +2145,7 @@  discard block
 block discarded – undo
2145 2145
 
2146 2146
     if (isset($_REQUEST['backandedit'])) {
2147 2147
         global $post;
2148
-        $post = (object)$gd_session->get('listing');
2148
+        $post = (object) $gd_session->get('listing');
2149 2149
         $listing_type = $post->listing_type;
2150 2150
         $title = $post->post_title;
2151 2151
         $desc = $post->post_desc;
@@ -2160,7 +2160,7 @@  discard block
 block discarded – undo
2160 2160
         $thumb_img_arr = geodir_get_images($post->ID);
2161 2161
         if ($thumb_img_arr) {
2162 2162
             foreach ($thumb_img_arr as $post_img) {
2163
-                $curImages .= $post_img->src . ',';
2163
+                $curImages .= $post_img->src.',';
2164 2164
             }
2165 2165
         }
2166 2166
 
@@ -2168,7 +2168,7 @@  discard block
 block discarded – undo
2168 2168
         $title = $post->post_title;
2169 2169
         $desc = $post->post_content;
2170 2170
         $kw_tags = $post->post_tags;
2171
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2171
+        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type.'_tags', array('fields' => 'names')));
2172 2172
     } else {
2173 2173
         $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2174 2174
     }
@@ -2179,20 +2179,20 @@  discard block
 block discarded – undo
2179 2179
 
2180 2180
     $post_type_info = geodir_get_posttype_info($listing_type);
2181 2181
 
2182
-    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? __($post_type_info['labels']['singular_name'], 'geodirectory') : __('Listing','geodirectory');
2182
+    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? __($post_type_info['labels']['singular_name'], 'geodirectory') : __('Listing', 'geodirectory');
2183 2183
     
2184 2184
     $package_info = array();
2185 2185
     $package_info = geodir_post_package_info($package_info, $post);
2186 2186
     ?>
2187
-    <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2188
-        <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2189
-        <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
2187
+    <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id()); ?>" method="post" enctype="multipart/form-data">
2188
+        <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type); ?>"/>
2189
+        <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type); ?>"/>
2190 2190
         <?php if ($page_id) { ?>
2191
-        <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id;?>"/>
2191
+        <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id; ?>"/>
2192 2192
         <?php } if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { ?>
2193
-            <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']);?>"/>
2193
+            <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']); ?>"/>
2194 2194
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2195
-            <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2195
+            <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']); ?>"/>
2196 2196
         <?php
2197 2197
         } 
2198 2198
         /**
@@ -2204,7 +2204,7 @@  discard block
 block discarded – undo
2204 2204
          */
2205 2205
         do_action('geodir_before_detail_fields');
2206 2206
         ?>
2207
-        <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2207
+        <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT; ?></h5>
2208 2208
         <?php
2209 2209
         /**
2210 2210
          * Called at the top of the add listing page form for frontend.
@@ -2225,10 +2225,10 @@  discard block
 block discarded – undo
2225 2225
                  * @param string $cpt_singular_name The singular title of the curent CPT.
2226 2226
                  * @param string $listing_type The CPT being requested. ie: gd_place.
2227 2227
                  */
2228
-                echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label>
2228
+                echo apply_filters('geodir_add_listing_title_label', sprintf(__('%s Title', 'geodirectory'), $cpt_singular_name), $cpt_singular_name, $listing_type); ?><span>*</span> </label>
2229 2229
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
2230 2230
                    value="<?php echo esc_attr(stripslashes($title)); ?>"/>
2231
-            <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2231
+            <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
2232 2232
         </div>
2233 2233
         <?php
2234 2234
         $show_editor = get_option('geodir_tiny_editor_on_add_listing');
@@ -2274,7 +2274,7 @@  discard block
 block discarded – undo
2274 2274
         $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2275 2275
         
2276 2276
         $desc_class = '';
2277
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2277
+        if ($desc_limit === '' || (int) $desc_limit > 0) {
2278 2278
             /**
2279 2279
              * Called on the add listing page form for frontend just before the description field.
2280 2280
              *
@@ -2287,7 +2287,7 @@  discard block
 block discarded – undo
2287 2287
             $desc_class = ' hidden';
2288 2288
         }
2289 2289
         ?>
2290
-        <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2290
+        <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class; ?>">
2291 2291
             <label><?php
2292 2292
                 /**
2293 2293
                  * Filter the add listing page description input label.
@@ -2297,7 +2297,7 @@  discard block
 block discarded – undo
2297 2297
                  * @param string $cpt_singular_name The singular title of the curent CPT.
2298 2298
                  * @param string $listing_type The CPT being requested. ie: gd_place.
2299 2299
                  */
2300
-                echo apply_filters('geodir_add_listing_description_label',sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2300
+                echo apply_filters('geodir_add_listing_description_label', sprintf(__('%s Description', 'geodirectory'), $cpt_singular_name), $cpt_singular_name, $listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2301 2301
             <?php
2302 2302
             if ($show_editor) {
2303 2303
                 $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
@@ -2306,16 +2306,16 @@  discard block
 block discarded – undo
2306 2306
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2307 2307
                 </div>
2308 2308
             <?php if ($desc_limit != '') { ?>
2309
-                <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit;?>");</script>
2309
+                <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit; ?>");</script>
2310 2310
             <?php } } else { ?>
2311 2311
                 <textarea field_type="textarea" name="post_desc" id="post_desc" class="geodir_textarea" maxlength="<?php echo $desc_limit; ?>"><?php echo $desc; ?></textarea>
2312 2312
             <?php } if ($desc_limit_msg != '') { ?>
2313 2313
                 <span class="geodir_message_note"><?php echo $desc_limit_msg; ?></span>
2314 2314
             <?php } ?>
2315
-            <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2315
+            <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory'); ?></span>
2316 2316
         </div>
2317 2317
         <?php
2318
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2318
+        if ($desc_limit === '' || (int) $desc_limit > 0) {
2319 2319
             /**
2320 2320
              * Called on the add listing page form for frontend just after the description field.
2321 2321
              *
@@ -2354,7 +2354,7 @@  discard block
 block discarded – undo
2354 2354
         $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2355 2355
         
2356 2356
         $tags_class = '';
2357
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2357
+        if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
2358 2358
             /**
2359 2359
              * Called on the add listing page form for frontend just before the tags field.
2360 2360
              *
@@ -2365,14 +2365,14 @@  discard block
 block discarded – undo
2365 2365
             $tags_class = ' hidden';
2366 2366
         }
2367 2367
         ?>
2368
-        <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2368
+        <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class; ?>">
2369 2369
             <label><?php echo TAGKW_TEXT; ?></label>
2370 2370
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
2371
-                   maxlength="<?php echo $kw_tags_count;?>"/>
2372
-            <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2371
+                   maxlength="<?php echo $kw_tags_count; ?>"/>
2372
+            <span class="geodir_message_note"><?php echo $kw_tags_msg; ?></span>
2373 2373
         </div>
2374 2374
         <?php
2375
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2375
+        if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
2376 2376
             /**
2377 2377
              * Called on the add listing page form for frontend just after the tags field.
2378 2378
              *
@@ -2398,7 +2398,7 @@  discard block
 block discarded – undo
2398 2398
         $thumb_img_arr = array();
2399 2399
         $totImg = 0;
2400 2400
         if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2401
-            $post = (object)$gd_session->get('listing');
2401
+            $post = (object) $gd_session->get('listing');
2402 2402
             if (isset($post->post_images))
2403 2403
                 $curImages = trim($post->post_images, ",");
2404 2404
 
@@ -2411,7 +2411,7 @@  discard block
 block discarded – undo
2411 2411
             $listing_type = $post->listing_type;
2412 2412
 
2413 2413
         } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2414
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2414
+            $post = geodir_get_post_info((int) $_REQUEST['pid']);
2415 2415
             $listing_type = $post->post_type;
2416 2416
             $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2417 2417
 
@@ -2425,7 +2425,7 @@  discard block
 block discarded – undo
2425 2425
                 //$curImages = $img->src.",";
2426 2426
             }
2427 2427
 
2428
-            $totImg = count((array)$thumb_img_arr);
2428
+            $totImg = count((array) $thumb_img_arr);
2429 2429
         }
2430 2430
 
2431 2431
         if ($curImages != '')
@@ -2446,15 +2446,15 @@  discard block
 block discarded – undo
2446 2446
         if ($show_image_input_box) {
2447 2447
             ?>
2448 2448
 
2449
-            <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2449
+            <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT; ?>
2450 2450
                 <?php if ($image_limit == 1) {
2451
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2451
+                    echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('image with this package', 'geodirectory').')</small>';
2452 2452
                 } ?>
2453 2453
                 <?php if ($image_limit > 1) {
2454
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2454
+                    echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('images with this package', 'geodirectory').')</small>';
2455 2455
                 } ?>
2456 2456
                 <?php if ($image_limit == '') {
2457
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2457
+                    echo '<br /><small>('.__('You can upload unlimited images with this package', 'geodirectory').')</small>';
2458 2458
                 } ?>
2459 2459
             </h5>
2460 2460
 
@@ -2469,11 +2469,11 @@  discard block
 block discarded – undo
2469 2469
                 <div
2470 2470
                     class="plupload-upload-uic hide-if-no-js <?php if ($multiple): ?>plupload-upload-uic-multiple<?php endif; ?>"
2471 2471
                     id="<?php echo $id; ?>plupload-upload-ui">
2472
-                    <h4><?php _e('Drop files to upload', 'geodirectory');?></h4><br/>
2472
+                    <h4><?php _e('Drop files to upload', 'geodirectory'); ?></h4><br/>
2473 2473
                     <input id="<?php echo $id; ?>plupload-browse-button" type="button"
2474 2474
                            value="<?php esc_attr_e('Select Files', 'geodirectory'); ?>" class="geodir_button"/>
2475 2475
                     <span class="ajaxnonceplu"
2476
-                          id="ajaxnonceplu<?php echo wp_create_nonce($id . 'pluploadan'); ?>"></span>
2476
+                          id="ajaxnonceplu<?php echo wp_create_nonce($id.'pluploadan'); ?>"></span>
2477 2477
                     <?php if ($width && $height): ?>
2478 2478
                         <span class="plupload-resize"></span>
2479 2479
                         <span class="plupload-width" id="plupload-width<?php echo $width; ?>"></span>
@@ -2486,7 +2486,7 @@  discard block
 block discarded – undo
2486 2486
                      id="<?php echo $id; ?>plupload-thumbs" style="border-top:1px solid #ccc; padding-top:10px;">
2487 2487
                 </div>
2488 2488
                 <span
2489
-                    id="upload-msg"><?php _e('Please drag &amp; drop the images to rearrange the order', 'geodirectory');?></span>
2489
+                    id="upload-msg"><?php _e('Please drag &amp; drop the images to rearrange the order', 'geodirectory'); ?></span>
2490 2490
                 <span id="<?php echo $id; ?>upload-error" style="display:none"></span>
2491 2491
             </div>
2492 2492
 
@@ -2498,7 +2498,7 @@  discard block
 block discarded – undo
2498 2498
          *
2499 2499
          * @since 1.0.0
2500 2500
          */
2501
-        do_action('geodir_after_main_form_fields');?>
2501
+        do_action('geodir_after_main_form_fields'); ?>
2502 2502
 
2503 2503
 
2504 2504
         <!-- add captcha code -->
@@ -2509,7 +2509,7 @@  discard block
 block discarded – undo
2509 2509
         </script>
2510 2510
         <noscript>
2511 2511
             <div>
2512
-                <label><?php _e('Type 64 into this box', 'geodirectory');?></label>
2512
+                <label><?php _e('Type 64 into this box', 'geodirectory'); ?></label>
2513 2513
                 <input type="text" id="geodir_spamblocker_top_form" name="geodir_spamblocker" value="" maxlength="10"/>
2514 2514
             </div>
2515 2515
         </noscript>
@@ -2519,10 +2519,10 @@  discard block
 block discarded – undo
2519 2519
         <!-- end captcha code -->
2520 2520
 
2521 2521
         <div id="geodir-add-listing-submit" class="geodir_form_row clear_both" style="padding:2px;text-align:center;">
2522
-            <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON;?>"
2523
-                   class="geodir_button" <?php echo $submit_button;?>/>
2522
+            <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON; ?>"
2523
+                   class="geodir_button" <?php echo $submit_button; ?>/>
2524 2524
             <span class="geodir_message_note"
2525
-                  style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory');?></span>
2525
+                  style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory'); ?></span>
2526 2526
         </div>
2527 2527
 
2528 2528
     </form>
@@ -2584,7 +2584,7 @@  discard block
 block discarded – undo
2584 2584
         class="<?php
2585 2585
         /** This action is documented in geodirectory_template_actions.php */
2586 2586
         echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2587
-        <?php dynamic_sidebar('Reg/Login Top Section');?>
2587
+        <?php dynamic_sidebar('Reg/Login Top Section'); ?>
2588 2588
     </div><!-- clearfix ends here-->
2589 2589
 <?php
2590 2590
 }
@@ -2606,7 +2606,7 @@  discard block
 block discarded – undo
2606 2606
 
2607 2607
     ?>
2608 2608
     <script type="text/javascript">
2609
-        <?php if ( $user_login ) { ?>
2609
+        <?php if ($user_login) { ?>
2610 2610
         setTimeout(function () {
2611 2611
             try {
2612 2612
                 d = document.getElementById('user_pass');
@@ -2623,7 +2623,7 @@  discard block
 block discarded – undo
2623 2623
         <?php } ?>
2624 2624
     </script>
2625 2625
     <script type="text/javascript">
2626
-        <?php if ( $user_login ) { ?>
2626
+        <?php if ($user_login) { ?>
2627 2627
         setTimeout(function () {
2628 2628
             try {
2629 2629
                 d = document.getElementById('user_pass');
@@ -2648,7 +2648,7 @@  discard block
 block discarded – undo
2648 2648
         foreach ($errors as $errorsObj) {
2649 2649
             foreach ($errorsObj as $key => $val) {
2650 2650
                 for ($i = 0; $i < count($val); $i++) {
2651
-                    echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2651
+                    echo "<div class=error_msg_fix>".$val[$i].'</div>';
2652 2652
                     $registration_error_msg = 1;
2653 2653
                 }
2654 2654
             }
@@ -2665,7 +2665,7 @@  discard block
 block discarded – undo
2665 2665
              *
2666 2666
              * @since 1.0.0
2667 2667
              */
2668
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2668
+            include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?>
2669 2669
         </div>
2670 2670
 
2671 2671
     <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
@@ -2677,7 +2677,7 @@  discard block
 block discarded – undo
2677 2677
              *
2678 2678
              * @since 1.0.0
2679 2679
              */
2680
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2680
+            include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?>
2681 2681
         </div>
2682 2682
 
2683 2683
     <?php } else { ?>
@@ -2689,7 +2689,7 @@  discard block
 block discarded – undo
2689 2689
              *
2690 2690
              * @since 1.0.0
2691 2691
              */
2692
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2692
+            include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?>
2693 2693
         </div>
2694 2694
         <div class="registration_form_r">
2695 2695
             <?php
@@ -2698,7 +2698,7 @@  discard block
 block discarded – undo
2698 2698
              *
2699 2699
              * @since 1.0.0
2700 2700
              */
2701
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2701
+            include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?>
2702 2702
         </div>
2703 2703
 
2704 2704
     <?php }?>
@@ -2734,12 +2734,12 @@  discard block
 block discarded – undo
2734 2734
     $gd_post_type = geodir_get_current_posttype();
2735 2735
     $post_type_info = get_post_type_object($gd_post_type);
2736 2736
 
2737
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2737
+    $add_string_in_title = __('All', 'geodirectory').' ';
2738 2738
     if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2739
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2739
+        $add_string_in_title = __('My Favorite', 'geodirectory').' ';
2740 2740
     }
2741 2741
 
2742
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2742
+    $list_title = $add_string_in_title.$post_type_info->labels->name;
2743 2743
     $single_name = $post_type_info->labels->singular_name;
2744 2744
 
2745 2745
     $taxonomy = geodir_get_taxonomies($gd_post_type);
@@ -2747,12 +2747,12 @@  discard block
 block discarded – undo
2747 2747
     if (!empty($term)) {
2748 2748
         $current_term = get_term_by('slug', $term, $taxonomy[0]);
2749 2749
         if (!empty($current_term))
2750
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2750
+            $list_title .= __(' in', 'geodirectory')." '".geodir_ucwords($current_term->name)."'";
2751 2751
     }
2752 2752
 
2753 2753
 
2754 2754
     if (is_search()) {
2755
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2755
+        $list_title = __('Search', 'geodirectory').' '.__($post_type_info->labels->name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
2756 2756
 
2757 2757
     }
2758 2758
     /** This action is documented in geodirectory_template_actions.php */
@@ -2761,11 +2761,11 @@  discard block
 block discarded – undo
2761 2761
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2762 2762
 
2763 2763
     $title = $list_title;
2764
-    if(geodir_is_page('author')){
2764
+    if (geodir_is_page('author')) {
2765 2765
         $gd_page = 'author';
2766
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2766
+        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2767 2767
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2768
-        }else{
2768
+        } else {
2769 2769
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2770 2770
         }
2771 2771
 
@@ -2779,16 +2779,16 @@  discard block
 block discarded – undo
2779 2779
      * @param string $title The page title including variables.
2780 2780
      * @param string $gd_page The GeoDirectory page type if any.
2781 2781
      */
2782
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2782
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2783 2783
 
2784
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2784
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.
2785 2785
         /**
2786 2786
          * Filter the author page title text.
2787 2787
          *
2788 2788
          * @since 1.0.0
2789 2789
          * @param string $list_title The title for the page.
2790 2790
          */
2791
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2791
+        apply_filters('geodir_author_page_title_text', $title).'</h1></header>';
2792 2792
 }
2793 2793
 
2794 2794
 
@@ -2993,19 +2993,19 @@  discard block
 block discarded – undo
2993 2993
     $post_type_info = get_post_type_object($gd_post_type);
2994 2994
 
2995 2995
     $pt_name = '';
2996
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2996
+    if (isset($post_type_info->labels->name)) {$pt_name = $post_type_info->labels->name; }
2997 2997
 
2998 2998
     if (is_search()) {
2999
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2999
+        $list_title = __('Search', 'geodirectory').' '.__($pt_name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
3000 3000
 
3001 3001
     }
3002 3002
     /** This action is documented in geodirectory_template_actions.php */
3003 3003
     $class = apply_filters('geodir_page_title_class', 'entry-title fn');
3004 3004
     /** This action is documented in geodirectory_template_actions.php */
3005 3005
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
3006
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
3006
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.
3007 3007
         /** This action is documented in geodirectory_template_actions.php */
3008
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
3008
+        apply_filters('geodir_listing_page_title', wptexturize($list_title)).'</h1></header>';
3009 3009
 }
3010 3010
 
3011 3011
 // action for adding the listings page top widget area
@@ -3409,7 +3409,7 @@  discard block
 block discarded – undo
3409 3409
         $gd_post_type = geodir_get_current_posttype();
3410 3410
         $post_type_info = get_post_type_object($gd_post_type);
3411 3411
 
3412
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3412
+        $list_title = __('Search', 'geodirectory').' '.__(ucfirst($post_type_info->labels->name), 'geodirectory').__(' :', 'geodirectory');
3413 3413
     }
3414 3414
     return $list_title;
3415 3415
 }
@@ -3425,7 +3425,7 @@  discard block
 block discarded – undo
3425 3425
  * @param string $position Position to add the post content. 'before' or 'after'. Default 'before'.
3426 3426
  * @param string $gd_page The geodirectory page type. Default null.
3427 3427
  */
3428
-function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
3428
+function geodir_add_page_content($position = 'before', $gd_page = '') {
3429 3429
     global $post;
3430 3430
 
3431 3431
     $gd_page_id = NULL;
Please login to merge, or discard this patch.
Indentation   +1811 added lines, -1811 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
  */
18 18
 function gd_compat_styles()
19 19
 {
20
-    $tc = get_option('theme_compatibility_setting');
21
-    echo "<style id='gd-compat-styles' type='text/css'>";
22
-    echo $tc['geodir_theme_compat_css'];
23
-    echo "</style>";
20
+	$tc = get_option('theme_compatibility_setting');
21
+	echo "<style id='gd-compat-styles' type='text/css'>";
22
+	echo $tc['geodir_theme_compat_css'];
23
+	echo "</style>";
24 24
 }
25 25
 
26 26
 /**
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
  */
32 32
 function gd_compat_script()
33 33
 {
34
-    $tc = get_option('theme_compatibility_setting');
35
-    echo "<script>";
36
-    echo $tc['geodir_theme_compat_js'];
37
-    echo " </script>";
34
+	$tc = get_option('theme_compatibility_setting');
35
+	echo "<script>";
36
+	echo $tc['geodir_theme_compat_js'];
37
+	echo " </script>";
38 38
 }
39 39
 
40 40
 /**
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
  */
48 48
 function geodir_top_content_add_dynamic()
49 49
 {
50
-    $tc = get_option('theme_compatibility_setting');
51
-    echo $tc['geodir_top_content_add'];
50
+	$tc = get_option('theme_compatibility_setting');
51
+	echo $tc['geodir_top_content_add'];
52 52
 }
53 53
 
54 54
 /**
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
  */
62 62
 function geodir_before_main_content_add_dynamic()
63 63
 {
64
-    $tc = get_option('theme_compatibility_setting');
65
-    echo $tc['geodir_before_main_content_add'];
64
+	$tc = get_option('theme_compatibility_setting');
65
+	echo $tc['geodir_before_main_content_add'];
66 66
 }
67 67
 
68 68
 /**
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
  */
76 76
 function geodir_full_page_class_dynamic()
77 77
 {
78
-    $tc = get_option('theme_compatibility_setting');
79
-    return $tc['geodir_full_page_class_filter'];
78
+	$tc = get_option('theme_compatibility_setting');
79
+	return $tc['geodir_full_page_class_filter'];
80 80
 }
81 81
 
82 82
 /**
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
  */
90 90
 function geodir_before_widget_dynamic()
91 91
 {
92
-    $tc = get_option('theme_compatibility_setting');
93
-    return $tc['geodir_before_widget_filter'];
92
+	$tc = get_option('theme_compatibility_setting');
93
+	return $tc['geodir_before_widget_filter'];
94 94
 }
95 95
 
96 96
 /**
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
  */
104 104
 function geodir_after_widget_dynamic()
105 105
 {
106
-    $tc = get_option('theme_compatibility_setting');
107
-    return $tc['geodir_after_widget_filter'];
106
+	$tc = get_option('theme_compatibility_setting');
107
+	return $tc['geodir_after_widget_filter'];
108 108
 }
109 109
 
110 110
 /**
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
  */
118 118
 function geodir_before_title_dynamic()
119 119
 {
120
-    $tc = get_option('theme_compatibility_setting');
121
-    return $tc['geodir_before_title_filter'];
120
+	$tc = get_option('theme_compatibility_setting');
121
+	return $tc['geodir_before_title_filter'];
122 122
 }
123 123
 
124 124
 /**
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
  */
132 132
 function geodir_after_title_dynamic()
133 133
 {
134
-    $tc = get_option('theme_compatibility_setting');
135
-    return $tc['geodir_after_title_filter'];
134
+	$tc = get_option('theme_compatibility_setting');
135
+	return $tc['geodir_after_title_filter'];
136 136
 }
137 137
 
138 138
 /**
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
  */
146 146
 function geodir_menu_li_class_dynamic()
147 147
 {
148
-    $tc = get_option('theme_compatibility_setting');
149
-    return $tc['geodir_menu_li_class_filter'];
148
+	$tc = get_option('theme_compatibility_setting');
149
+	return $tc['geodir_menu_li_class_filter'];
150 150
 }
151 151
 
152 152
 /**
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
  */
160 160
 function geodir_sub_menu_ul_class_dynamic()
161 161
 {
162
-    $tc = get_option('theme_compatibility_setting');
163
-    return $tc['geodir_sub_menu_ul_class_filter'];
162
+	$tc = get_option('theme_compatibility_setting');
163
+	return $tc['geodir_sub_menu_ul_class_filter'];
164 164
 }
165 165
 
166 166
 /**
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
  */
174 174
 function geodir_sub_menu_li_class_dynamic()
175 175
 {
176
-    $tc = get_option('theme_compatibility_setting');
177
-    return $tc['geodir_sub_menu_li_class_filter'];
176
+	$tc = get_option('theme_compatibility_setting');
177
+	return $tc['geodir_sub_menu_li_class_filter'];
178 178
 }
179 179
 
180 180
 /**
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
  */
188 188
 function geodir_menu_a_class_dynamic()
189 189
 {
190
-    $tc = get_option('theme_compatibility_setting');
191
-    return $tc['geodir_menu_a_class_filter'];
190
+	$tc = get_option('theme_compatibility_setting');
191
+	return $tc['geodir_menu_a_class_filter'];
192 192
 }
193 193
 
194 194
 /**
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
  */
202 202
 function geodir_sub_menu_a_class_dynamic()
203 203
 {
204
-    $tc = get_option('theme_compatibility_setting');
205
-    return $tc['geodir_sub_menu_a_class_filter'];
204
+	$tc = get_option('theme_compatibility_setting');
205
+	return $tc['geodir_sub_menu_a_class_filter'];
206 206
 }
207 207
 
208 208
 /**
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
  */
216 216
 function geodir_location_switcher_menu_li_class_dynamic()
217 217
 {
218
-    $tc = get_option('theme_compatibility_setting');
219
-    return $tc['geodir_location_switcher_menu_li_class_filter'];
218
+	$tc = get_option('theme_compatibility_setting');
219
+	return $tc['geodir_location_switcher_menu_li_class_filter'];
220 220
 }
221 221
 
222 222
 /**
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
  */
230 230
 function geodir_location_switcher_menu_a_class_dynamic()
231 231
 {
232
-    $tc = get_option('theme_compatibility_setting');
233
-    return $tc['geodir_location_switcher_menu_a_class_filter'];
232
+	$tc = get_option('theme_compatibility_setting');
233
+	return $tc['geodir_location_switcher_menu_a_class_filter'];
234 234
 }
235 235
 
236 236
 /**
@@ -243,8 +243,8 @@  discard block
 block discarded – undo
243 243
  */
244 244
 function geodir_location_switcher_menu_sub_ul_class_dynamic()
245 245
 {
246
-    $tc = get_option('theme_compatibility_setting');
247
-    return $tc['geodir_location_switcher_menu_sub_ul_class_filter'];
246
+	$tc = get_option('theme_compatibility_setting');
247
+	return $tc['geodir_location_switcher_menu_sub_ul_class_filter'];
248 248
 }
249 249
 
250 250
 /**
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
  */
258 258
 function geodir_location_switcher_menu_sub_li_class_dynamic()
259 259
 {
260
-    $tc = get_option('theme_compatibility_setting');
261
-    return $tc['geodir_location_switcher_menu_sub_li_class_filter'];
260
+	$tc = get_option('theme_compatibility_setting');
261
+	return $tc['geodir_location_switcher_menu_sub_li_class_filter'];
262 262
 }
263 263
 
264 264
 
@@ -275,107 +275,107 @@  discard block
 block discarded – undo
275 275
 function geodir_content_actions_dynamic()
276 276
 {
277 277
 
278
-    $tc = get_option('theme_compatibility_setting');
278
+	$tc = get_option('theme_compatibility_setting');
279 279
 //print_r($tc);
280
-    if (empty($tc)) {
281
-        return;
282
-    }
283
-
284
-    //php
285
-    if (!empty($tc['geodir_theme_compat_code'])) {
286
-        include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
287
-    }
288
-
289
-    //geodir_full_page_class
290
-    if (!empty($tc['geodir_full_page_class_filter'])) {
291
-        add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
292
-    }
293
-
294
-    //widget before filter
295
-    if (!empty($tc['geodir_before_widget_filter'])) {
296
-        add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
297
-    }
298
-
299
-    //widget after filter
300
-    if (!empty($tc['geodir_after_widget_filter'])) {
301
-        add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
302
-    }
303
-
304
-    //widget before title filter
305
-    if (!empty($tc['geodir_before_title_filter'])) {
306
-        add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
307
-    }
308
-
309
-    //widget before title filter
310
-    if (!empty($tc['geodir_after_title_filter'])) {
311
-        add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
312
-    }
313
-
314
-    //menu li class
315
-    if (!empty($tc['geodir_menu_li_class_filter'])) {
316
-        add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
317
-    }
318
-
319
-    //menu ul class
320
-    if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
321
-        add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
322
-    }
323
-
324
-    //menu sub li class
325
-    if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
326
-        add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
327
-    }
328
-
329
-    //menu a class
330
-    if (!empty($tc['geodir_menu_a_class_filter'])) {
331
-        add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
332
-    }
333
-
334
-    //menu sub a class
335
-    if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
336
-        add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
337
-    }
338
-
339
-    //location menu li class
340
-    if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
341
-        add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
342
-    }
343
-
344
-    //location menu sub ul class
345
-    if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
346
-        add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
347
-    }
348
-
349
-    //location menu sub li class
350
-    if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
351
-        add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
352
-    }
353
-
354
-    //location menu a class
355
-    if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
356
-        add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
357
-    }
358
-
359
-    // compat styles
360
-    if (!empty($tc['geodir_theme_compat_css'])) {
361
-        add_action('wp_head', 'gd_compat_styles');
362
-    }
363
-
364
-    // compat js
365
-    if (!empty($tc['geodir_theme_compat_js'])) {
366
-        add_action('wp_footer', 'gd_compat_script');
367
-    }
368
-
369
-
370
-    // geodir_top_content_add
371
-    if (!empty($tc['geodir_top_content_add'])) {
372
-        add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
373
-    }
374
-
375
-    // geodir_before_main_content_add
376
-    if (!empty($tc['geodir_before_main_content_add'])) {
377
-        add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
378
-    }
280
+	if (empty($tc)) {
281
+		return;
282
+	}
283
+
284
+	//php
285
+	if (!empty($tc['geodir_theme_compat_code'])) {
286
+		include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
287
+	}
288
+
289
+	//geodir_full_page_class
290
+	if (!empty($tc['geodir_full_page_class_filter'])) {
291
+		add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
292
+	}
293
+
294
+	//widget before filter
295
+	if (!empty($tc['geodir_before_widget_filter'])) {
296
+		add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
297
+	}
298
+
299
+	//widget after filter
300
+	if (!empty($tc['geodir_after_widget_filter'])) {
301
+		add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
302
+	}
303
+
304
+	//widget before title filter
305
+	if (!empty($tc['geodir_before_title_filter'])) {
306
+		add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
307
+	}
308
+
309
+	//widget before title filter
310
+	if (!empty($tc['geodir_after_title_filter'])) {
311
+		add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
312
+	}
313
+
314
+	//menu li class
315
+	if (!empty($tc['geodir_menu_li_class_filter'])) {
316
+		add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
317
+	}
318
+
319
+	//menu ul class
320
+	if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
321
+		add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
322
+	}
323
+
324
+	//menu sub li class
325
+	if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
326
+		add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
327
+	}
328
+
329
+	//menu a class
330
+	if (!empty($tc['geodir_menu_a_class_filter'])) {
331
+		add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
332
+	}
333
+
334
+	//menu sub a class
335
+	if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
336
+		add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
337
+	}
338
+
339
+	//location menu li class
340
+	if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
341
+		add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
342
+	}
343
+
344
+	//location menu sub ul class
345
+	if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
346
+		add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
347
+	}
348
+
349
+	//location menu sub li class
350
+	if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
351
+		add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
352
+	}
353
+
354
+	//location menu a class
355
+	if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
356
+		add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
357
+	}
358
+
359
+	// compat styles
360
+	if (!empty($tc['geodir_theme_compat_css'])) {
361
+		add_action('wp_head', 'gd_compat_styles');
362
+	}
363
+
364
+	// compat js
365
+	if (!empty($tc['geodir_theme_compat_js'])) {
366
+		add_action('wp_footer', 'gd_compat_script');
367
+	}
368
+
369
+
370
+	// geodir_top_content_add
371
+	if (!empty($tc['geodir_top_content_add'])) {
372
+		add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
373
+	}
374
+
375
+	// geodir_before_main_content_add
376
+	if (!empty($tc['geodir_before_main_content_add'])) {
377
+		add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
378
+	}
379 379
 
380 380
 
381 381
 }
@@ -398,23 +398,23 @@  discard block
 block discarded – undo
398 398
  */
399 399
 function geodir_action_wrapper_open($type = '', $id = '', $class = '')
400 400
 {
401
-    $tc = get_option('theme_compatibility_setting');
402
-    if (!empty($tc['geodir_wrapper_open_replace'])) {
403
-        $text = $tc['geodir_wrapper_open_replace'];
404
-    } else {
405
-        $text = '<div id="[id]" class="[class]">';
406
-    }
401
+	$tc = get_option('theme_compatibility_setting');
402
+	if (!empty($tc['geodir_wrapper_open_replace'])) {
403
+		$text = $tc['geodir_wrapper_open_replace'];
404
+	} else {
405
+		$text = '<div id="[id]" class="[class]">';
406
+	}
407 407
 
408
-    if (!empty($tc['geodir_wrapper_open_id'])) {
409
-        $id = $tc['geodir_wrapper_open_id'];
410
-    }
411
-    if (!empty($tc['geodir_wrapper_open_class'])) {
412
-        $class = $tc['geodir_wrapper_open_class'];
413
-    }
408
+	if (!empty($tc['geodir_wrapper_open_id'])) {
409
+		$id = $tc['geodir_wrapper_open_id'];
410
+	}
411
+	if (!empty($tc['geodir_wrapper_open_class'])) {
412
+		$class = $tc['geodir_wrapper_open_class'];
413
+	}
414 414
 
415
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
415
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
416 416
 
417
-    echo $text;
417
+	echo $text;
418 418
 }
419 419
 
420 420
 // action for adding the wrapperdiv closing tag
@@ -429,14 +429,14 @@  discard block
 block discarded – undo
429 429
  */
430 430
 function geodir_action_wrapper_close($type = '')
431 431
 {
432
-    $tc = get_option('theme_compatibility_setting');
433
-    if (!empty($tc['geodir_wrapper_close_replace'])) {
434
-        $text = $tc['geodir_wrapper_close_replace'];
435
-    } else {
436
-        $text = '</div><!-- wrapper ends here-->';
437
-    }
432
+	$tc = get_option('theme_compatibility_setting');
433
+	if (!empty($tc['geodir_wrapper_close_replace'])) {
434
+		$text = $tc['geodir_wrapper_close_replace'];
435
+	} else {
436
+		$text = '</div><!-- wrapper ends here-->';
437
+	}
438 438
 
439
-    echo $text;
439
+	echo $text;
440 440
 }
441 441
 
442 442
 // action for adding the content div opening tag
@@ -452,35 +452,35 @@  discard block
 block discarded – undo
452 452
  */
453 453
 function geodir_action_wrapper_content_open($type = '', $id = '', $class = '')
454 454
 {
455
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
456
-        $width_css = 'style="width:' . $width . '%;"';
457
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
458
-        $width_css = 'style="width:' . $width . '%;"';
459
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
460
-        $width_css = 'style="width:' . $width . '%;"';
461
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
462
-        $width_css = 'style="width:' . $width . '%;"';
463
-    } else {
464
-        $width_css = '';
465
-    }
466
-
467
-    $tc = get_option('theme_compatibility_setting');
468
-    if (!empty($tc['geodir_wrapper_content_open_replace'])) {
469
-        $text = $tc['geodir_wrapper_content_open_replace'];
470
-    } else {
471
-        $text = '<div id="[id]" class="[class]" role="main" [width_css]>';
472
-    }
473
-
474
-    if (!empty($tc['geodir_wrapper_content_open_id'])) {
475
-        $id = $tc['geodir_wrapper_content_open_id'];
476
-    }
477
-    if (!empty($tc['geodir_wrapper_content_open_class'])) {
478
-        $class = $tc['geodir_wrapper_content_open_class'];
479
-    }
480
-
481
-    $text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
482
-
483
-    echo $text;
455
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
456
+		$width_css = 'style="width:' . $width . '%;"';
457
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
458
+		$width_css = 'style="width:' . $width . '%;"';
459
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
460
+		$width_css = 'style="width:' . $width . '%;"';
461
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
462
+		$width_css = 'style="width:' . $width . '%;"';
463
+	} else {
464
+		$width_css = '';
465
+	}
466
+
467
+	$tc = get_option('theme_compatibility_setting');
468
+	if (!empty($tc['geodir_wrapper_content_open_replace'])) {
469
+		$text = $tc['geodir_wrapper_content_open_replace'];
470
+	} else {
471
+		$text = '<div id="[id]" class="[class]" role="main" [width_css]>';
472
+	}
473
+
474
+	if (!empty($tc['geodir_wrapper_content_open_id'])) {
475
+		$id = $tc['geodir_wrapper_content_open_id'];
476
+	}
477
+	if (!empty($tc['geodir_wrapper_content_open_class'])) {
478
+		$class = $tc['geodir_wrapper_content_open_class'];
479
+	}
480
+
481
+	$text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
482
+
483
+	echo $text;
484 484
 }
485 485
 
486 486
 // action for adding the primary div closing tag
@@ -494,13 +494,13 @@  discard block
 block discarded – undo
494 494
  */
495 495
 function geodir_action_wrapper_content_close($type = '')
496 496
 {
497
-    $tc = get_option('theme_compatibility_setting');
498
-    if (!empty($tc['geodir_wrapper_content_close_replace'])) {
499
-        $text = $tc['geodir_wrapper_content_close_replace'];
500
-    } else {
501
-        $text = '</div><!-- content ends here-->';
502
-    }
503
-    echo $text;
497
+	$tc = get_option('theme_compatibility_setting');
498
+	if (!empty($tc['geodir_wrapper_content_close_replace'])) {
499
+		$text = $tc['geodir_wrapper_content_close_replace'];
500
+	} else {
501
+		$text = '</div><!-- content ends here-->';
502
+	}
503
+	echo $text;
504 504
 }
505 505
 
506 506
 // action for adding the <article> opening tag
@@ -518,24 +518,24 @@  discard block
 block discarded – undo
518 518
  */
519 519
 function geodir_action_article_open($type = '', $id = '', $class = '', $itemtype = '')
520 520
 {
521
-    $class = implode(" ", $class);
522
-    $tc = get_option('theme_compatibility_setting');
523
-    if (!empty($tc['geodir_article_open_replace'])) {
524
-        $text = $tc['geodir_article_open_replace'];
525
-    } else {
526
-        $text = '<article  id="[id]" class="[class]" >';
527
-    }
521
+	$class = implode(" ", $class);
522
+	$tc = get_option('theme_compatibility_setting');
523
+	if (!empty($tc['geodir_article_open_replace'])) {
524
+		$text = $tc['geodir_article_open_replace'];
525
+	} else {
526
+		$text = '<article  id="[id]" class="[class]" >';
527
+	}
528 528
 
529
-    if (!empty($tc['geodir_article_open_id'])) {
530
-        $id = $tc['geodir_article_open_id'];
531
-    }
532
-    if (!empty($tc['geodir_article_open_class'])) {
533
-        $class = $tc['geodir_article_open_class'];
534
-    }
529
+	if (!empty($tc['geodir_article_open_id'])) {
530
+		$id = $tc['geodir_article_open_id'];
531
+	}
532
+	if (!empty($tc['geodir_article_open_class'])) {
533
+		$class = $tc['geodir_article_open_class'];
534
+	}
535 535
 
536
-    $text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
536
+	$text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
537 537
 
538
-    echo $text;
538
+	echo $text;
539 539
 }
540 540
 
541 541
 // action for adding the primary div closing tag
@@ -549,13 +549,13 @@  discard block
 block discarded – undo
549 549
  */
550 550
 function geodir_action_article_close($type = '')
551 551
 {
552
-    $tc = get_option('theme_compatibility_setting');
553
-    if (!empty($tc['geodir_article_close_replace'])) {
554
-        $text = $tc['geodir_article_close_replace'];
555
-    } else {
556
-        $text = '</article><!-- article ends here-->';
557
-    }
558
-    echo $text;
552
+	$tc = get_option('theme_compatibility_setting');
553
+	if (!empty($tc['geodir_article_close_replace'])) {
554
+		$text = $tc['geodir_article_close_replace'];
555
+	} else {
556
+		$text = '</article><!-- article ends here-->';
557
+	}
558
+	echo $text;
559 559
 }
560 560
 
561 561
 // action for adding the sidebar opening tag
@@ -572,35 +572,35 @@  discard block
 block discarded – undo
572 572
  */
573 573
 function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
574 574
 {
575
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
576
-        $width_css = 'style="width:' . $width . '%;"';
577
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
578
-        $width_css = 'style="width:' . $width . '%;"';
579
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
580
-        $width_css = 'style="width:' . $width . '%;"';
581
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
582
-        $width_css = 'style="width:' . $width . '%;"';
583
-    } else {
584
-        $width_css = '';
585
-    }
586
-
587
-    $tc = get_option('theme_compatibility_setting');
588
-    if (!empty($tc['geodir_sidebar_right_open_replace'])) {
589
-        $text = $tc['geodir_sidebar_right_open_replace'];
590
-    } else {
591
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
592
-    }
593
-
594
-    if (!empty($tc['geodir_sidebar_right_open_id'])) {
595
-        $id = $tc['geodir_sidebar_right_open_id'];
596
-    }
597
-    if (!empty($tc['geodir_sidebar_right_open_class'])) {
598
-        $class = $tc['geodir_sidebar_right_open_class'];
599
-    }
600
-
601
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
602
-
603
-    echo $text;
575
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
576
+		$width_css = 'style="width:' . $width . '%;"';
577
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
578
+		$width_css = 'style="width:' . $width . '%;"';
579
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
580
+		$width_css = 'style="width:' . $width . '%;"';
581
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
582
+		$width_css = 'style="width:' . $width . '%;"';
583
+	} else {
584
+		$width_css = '';
585
+	}
586
+
587
+	$tc = get_option('theme_compatibility_setting');
588
+	if (!empty($tc['geodir_sidebar_right_open_replace'])) {
589
+		$text = $tc['geodir_sidebar_right_open_replace'];
590
+	} else {
591
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
592
+	}
593
+
594
+	if (!empty($tc['geodir_sidebar_right_open_id'])) {
595
+		$id = $tc['geodir_sidebar_right_open_id'];
596
+	}
597
+	if (!empty($tc['geodir_sidebar_right_open_class'])) {
598
+		$class = $tc['geodir_sidebar_right_open_class'];
599
+	}
600
+
601
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
602
+
603
+	echo $text;
604 604
 }
605 605
 
606 606
 // action for adding the primary div closing tag
@@ -614,13 +614,13 @@  discard block
 block discarded – undo
614 614
  */
615 615
 function geodir_action_sidebar_right_close($type = '')
616 616
 {
617
-    $tc = get_option('theme_compatibility_setting');
618
-    if (!empty($tc['geodir_sidebar_right_close_replace'])) {
619
-        $text = $tc['geodir_sidebar_right_close_replace'];
620
-    } else {
621
-        $text = '</aside><!-- sidebar ends here-->';
622
-    }
623
-    echo $text;
617
+	$tc = get_option('theme_compatibility_setting');
618
+	if (!empty($tc['geodir_sidebar_right_close_replace'])) {
619
+		$text = $tc['geodir_sidebar_right_close_replace'];
620
+	} else {
621
+		$text = '</aside><!-- sidebar ends here-->';
622
+	}
623
+	echo $text;
624 624
 }
625 625
 
626 626
 
@@ -641,121 +641,121 @@  discard block
 block discarded – undo
641 641
  */
642 642
 function geodir_action_geodir_set_preview_post()
643 643
 {
644
-    global $post, $preview, $gd_session;
645
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
646
-    if (!$preview || $is_backend_preview) {
647
-        return;
648
-    }// bail if not previewing
649
-
650
-    $listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
651
-
652
-    $fields_info = geodir_get_custom_fields_type($listing_type);
653
-
654
-    foreach ($_REQUEST as $pkey => $pval) {
655
-        if ($pkey == 'geodir_video') {
656
-            $tags = '<iframe>';
657
-        } else if ($pkey == 'post_desc') {
658
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
659
-        } else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
660
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
661
-        } else if (is_array($_REQUEST[$pkey])) {
662
-            $tags = 'skip_field';
663
-        } else {
664
-            $tags = '';
665
-        }
666
-        /**
667
-         * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
668
-         *
669
-         * @since 1.0.0
670
-         * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'.
671
-         * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
672
-         */
673
-        $tags = apply_filters('geodir_save_post_key', $tags, $pkey);
674
-
675
-        if ($tags != 'skip_field') {
676
-            $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
677
-        }
678
-    }
679
-
680
-    $post = (object)$_REQUEST;
681
-
682
-
683
-    if (isset($post->video)) {
684
-        $post->video = stripslashes($post->video);
685
-    }
686
-
687
-    if (isset($post->Video2)) {
688
-        $post->Video2 = stripslashes($post->Video2);
689
-    }
690
-
691
-    $post_type = $post->listing_type;
692
-    $post_type_info = get_post_type_object($post_type);
693
-
694
-    $listing_label = $post_type_info->labels->singular_name;
695
-
696
-    $term_icon = '';
697
-
698
-    if (!empty($post->post_category)) {
699
-        foreach ($post->post_category as $post_taxonomy => $post_term) {
700
-
701
-            if ($post_term != '' && !is_array($post_term)) {
702
-                $post_term = explode(',', trim($post_term, ','));
703
-            }
644
+	global $post, $preview, $gd_session;
645
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
646
+	if (!$preview || $is_backend_preview) {
647
+		return;
648
+	}// bail if not previewing
649
+
650
+	$listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
651
+
652
+	$fields_info = geodir_get_custom_fields_type($listing_type);
653
+
654
+	foreach ($_REQUEST as $pkey => $pval) {
655
+		if ($pkey == 'geodir_video') {
656
+			$tags = '<iframe>';
657
+		} else if ($pkey == 'post_desc') {
658
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
659
+		} else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
660
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
661
+		} else if (is_array($_REQUEST[$pkey])) {
662
+			$tags = 'skip_field';
663
+		} else {
664
+			$tags = '';
665
+		}
666
+		/**
667
+		 * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
668
+		 *
669
+		 * @since 1.0.0
670
+		 * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'.
671
+		 * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
672
+		 */
673
+		$tags = apply_filters('geodir_save_post_key', $tags, $pkey);
674
+
675
+		if ($tags != 'skip_field') {
676
+			$_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
677
+		}
678
+	}
679
+
680
+	$post = (object)$_REQUEST;
681
+
682
+
683
+	if (isset($post->video)) {
684
+		$post->video = stripslashes($post->video);
685
+	}
686
+
687
+	if (isset($post->Video2)) {
688
+		$post->Video2 = stripslashes($post->Video2);
689
+	}
690
+
691
+	$post_type = $post->listing_type;
692
+	$post_type_info = get_post_type_object($post_type);
693
+
694
+	$listing_label = $post_type_info->labels->singular_name;
695
+
696
+	$term_icon = '';
697
+
698
+	if (!empty($post->post_category)) {
699
+		foreach ($post->post_category as $post_taxonomy => $post_term) {
700
+
701
+			if ($post_term != '' && !is_array($post_term)) {
702
+				$post_term = explode(',', trim($post_term, ','));
703
+			}
704 704
 
705
-            if (is_array($post_term)) {
706
-                $post_term = array_unique($post_term);
707
-            }
705
+			if (is_array($post_term)) {
706
+				$post_term = array_unique($post_term);
707
+			}
708 708
 
709
-            if (!empty($post_term)) {
710
-                foreach ($post_term as $cat_id) {
711
-                    $cat_id = trim($cat_id);
712
-
713
-                    if ($cat_id != '') {
714
-                        $term_icon = get_option('geodir_default_marker_icon');
715
-
716
-                        if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
717
-                            if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
718
-                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
719
-                                    $term_icon = $term_icon_url['src'];
720
-                                break;
721
-                            }
722
-                        }
723
-                    }
724
-                }
725
-            }
726
-        }
727
-    }
709
+			if (!empty($post_term)) {
710
+				foreach ($post_term as $cat_id) {
711
+					$cat_id = trim($cat_id);
712
+
713
+					if ($cat_id != '') {
714
+						$term_icon = get_option('geodir_default_marker_icon');
715
+
716
+						if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
717
+							if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
718
+								if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
719
+									$term_icon = $term_icon_url['src'];
720
+								break;
721
+							}
722
+						}
723
+					}
724
+				}
725
+			}
726
+		}
727
+	}
728 728
 
729
-    $post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
730
-    $post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
729
+	$post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
730
+	$post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
731 731
 
732
-    $srcharr = array("'", "/", "-", '"', '\\');
733
-    $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
732
+	$srcharr = array("'", "/", "-", '"', '\\');
733
+	$replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
734 734
 
735
-    $json_title = str_replace($srcharr, $replarr, $post->post_title);
735
+	$json_title = str_replace($srcharr, $replarr, $post->post_title);
736 736
 
737
-    $json = '{';
738
-    $json .= '"post_preview": "1",';
739
-    $json .= '"t": "' . $json_title . '",';
740
-    $json .= '"lt": "' . $post_latitude . '",';
741
-    $json .= '"ln": "' . $post_longitude . '",';
742
-    $json .= '"i":"' . $term_icon . '"';
743
-    $json .= '}';
737
+	$json = '{';
738
+	$json .= '"post_preview": "1",';
739
+	$json .= '"t": "' . $json_title . '",';
740
+	$json .= '"lt": "' . $post_latitude . '",';
741
+	$json .= '"ln": "' . $post_longitude . '",';
742
+	$json .= '"i":"' . $term_icon . '"';
743
+	$json .= '}';
744 744
 
745
-    $post->marker_json = $json;
745
+	$post->marker_json = $json;
746 746
 
747
-    $gd_session->set('listing', $_REQUEST);
747
+	$gd_session->set('listing', $_REQUEST);
748 748
 
749
-    // we need to define a few things to trick the setup_postdata
750
-    if (!isset($post->ID)) {
751
-        $post->ID = '';
752
-        $post->post_author = '';
753
-        $post->post_date = '';
754
-        $post->post_content = '';
755
-        $post->default_category = '';
756
-        $post->post_type = '';
757
-    }
758
-    setup_postdata($post);
749
+	// we need to define a few things to trick the setup_postdata
750
+	if (!isset($post->ID)) {
751
+		$post->ID = '';
752
+		$post->post_author = '';
753
+		$post->post_date = '';
754
+		$post->post_content = '';
755
+		$post->default_category = '';
756
+		$post->post_type = '';
757
+	}
758
+	setup_postdata($post);
759 759
 }
760 760
 
761 761
 /**
@@ -767,15 +767,15 @@  discard block
 block discarded – undo
767 767
  */
768 768
 function geodir_action_geodir_preview_code()
769 769
 {
770
-    global $preview;
770
+	global $preview;
771 771
 
772
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
772
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
773 773
 
774
-    if (!$preview || $is_backend_preview) {
775
-        return;
776
-    }// bail if not previewing
774
+	if (!$preview || $is_backend_preview) {
775
+		return;
776
+	}// bail if not previewing
777 777
 
778
-    geodir_get_template_part('preview', 'buttons');
778
+	geodir_get_template_part('preview', 'buttons');
779 779
 }
780 780
 
781 781
 // action for adding the details page top widget area
@@ -791,20 +791,20 @@  discard block
 block discarded – undo
791 791
  */
792 792
 function geodir_action_geodir_sidebar_detail_top($class = '')
793 793
 {
794
-    if (get_option('geodir_show_detail_top_section')) { ?>
794
+	if (get_option('geodir_show_detail_top_section')) { ?>
795 795
         <div
796 796
             class="<?php
797
-            /**
798
-             * Filter the div class for the wrapper of the full width widget areas.
799
-             *
800
-             * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas.
801
-             *
802
-             * @since 1.0.0
803
-             * @param string $class The class of the div.
804
-             * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section',
805
-             *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
806
-             */
807
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
797
+			/**
798
+			 * Filter the div class for the wrapper of the full width widget areas.
799
+			 *
800
+			 * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas.
801
+			 *
802
+			 * @since 1.0.0
803
+			 * @param string $class The class of the div.
804
+			 * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section',
805
+			 *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
806
+			 */
807
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
808 808
             <?php dynamic_sidebar('geodir_detail_top'); ?>
809 809
         </div>
810 810
     <?php }
@@ -828,11 +828,11 @@  discard block
 block discarded – undo
828 828
  */
829 829
 function geodir_action_geodir_sidebar_detail_bottom_section($class = '')
830 830
 {
831
-    if (get_option('geodir_show_detail_bottom_section')) { ?>
831
+	if (get_option('geodir_show_detail_bottom_section')) { ?>
832 832
         <div
833 833
             class="<?php
834
-            /** This action is documented in geodirectory_template_actions.php */
835
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
834
+			/** This action is documented in geodirectory_template_actions.php */
835
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
836 836
             <?php dynamic_sidebar('geodir_detail_bottom'); ?>
837 837
         </div><!-- clearfix ends here-->
838 838
     <?php }
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
  */
847 847
 function geodir_details_sidebar_widget_area()
848 848
 {
849
-    dynamic_sidebar('geodir_detail_sidebar');
849
+	dynamic_sidebar('geodir_detail_sidebar');
850 850
 }
851 851
 
852 852
 /**
@@ -857,12 +857,12 @@  discard block
 block discarded – undo
857 857
  */
858 858
 function geodir_details_sidebar_place_details()
859 859
 {
860
-    /**
861
-     * Used to add items to the details page sidebar.
862
-     *
863
-     * @since 1.0.0
864
-     */
865
-    do_action('geodir_detail_page_sidebar');
860
+	/**
861
+	 * Used to add items to the details page sidebar.
862
+	 *
863
+	 * @since 1.0.0
864
+	 */
865
+	do_action('geodir_detail_page_sidebar');
866 866
 }
867 867
 
868 868
 add_action('geodir_detail_sidebar_inside', 'geodir_details_sidebar_place_details', 10);
@@ -877,68 +877,68 @@  discard block
 block discarded – undo
877 877
  */
878 878
 function geodir_action_details_sidebar()
879 879
 {
880
-    // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
881
-    if (get_option('geodir_detail_sidebar_left_section')) {
882
-        /**
883
-         * Called before the details page left sidebar is opened.
884
-         *
885
-         * This is used to add opening wrapper HTML to the details page left sidebar.
886
-         *
887
-         * @since 1.0.0
888
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
889
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
890
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
891
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
892
-         */
893
-        do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'https://schema.org/WPSideBar');
894
-        ?>
880
+	// this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
881
+	if (get_option('geodir_detail_sidebar_left_section')) {
882
+		/**
883
+		 * Called before the details page left sidebar is opened.
884
+		 *
885
+		 * This is used to add opening wrapper HTML to the details page left sidebar.
886
+		 *
887
+		 * @since 1.0.0
888
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
889
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
890
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
891
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
892
+		 */
893
+		do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'https://schema.org/WPSideBar');
894
+		?>
895 895
         <div class="geodir-content-left geodir-sidebar-wrap"><?php
896
-        /**
897
-         * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
898
-         *
899
-         * This is used to add all info to the details page sidebars.
900
-         *
901
-         * @since 1.0.0
902
-         */
903
-        do_action('geodir_detail_sidebar_inside');
904
-        ?></div><!-- end geodir-content-left --><?php
905
-        /**
906
-         * Called after the details page left sidebar.
907
-         *
908
-         * This is used to add closing wrapper HTML to the details page left sidebar.
909
-         *
910
-         * @since 1.0.0
911
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
912
-         */
913
-        do_action('geodir_sidebar_left_close', 'details-page');
914
-    } else {
915
-        /**
916
-         * Called before the details page right sidebar is opened.
917
-         *
918
-         * This is used to add opening wrapper HTML to the details page right sidebar.
919
-         *
920
-         * @since 1.0.0
921
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
922
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
923
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
924
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
925
-         */
926
-        do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
927
-        ?>
896
+		/**
897
+		 * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
898
+		 *
899
+		 * This is used to add all info to the details page sidebars.
900
+		 *
901
+		 * @since 1.0.0
902
+		 */
903
+		do_action('geodir_detail_sidebar_inside');
904
+		?></div><!-- end geodir-content-left --><?php
905
+		/**
906
+		 * Called after the details page left sidebar.
907
+		 *
908
+		 * This is used to add closing wrapper HTML to the details page left sidebar.
909
+		 *
910
+		 * @since 1.0.0
911
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
912
+		 */
913
+		do_action('geodir_sidebar_left_close', 'details-page');
914
+	} else {
915
+		/**
916
+		 * Called before the details page right sidebar is opened.
917
+		 *
918
+		 * This is used to add opening wrapper HTML to the details page right sidebar.
919
+		 *
920
+		 * @since 1.0.0
921
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
922
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
923
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
924
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
925
+		 */
926
+		do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
927
+		?>
928 928
         <div class="geodir-content-right geodir-sidebar-wrap"><?php
929
-        /** This action is documented in geodirectory_template_actions.php */
930
-        do_action('geodir_detail_sidebar_inside');
931
-        ?></div><!-- end geodir-content-right --><?php
932
-        /**
933
-         * Called after the details page right sidebar.
934
-         *
935
-         * This is used to add closing wrapper HTML to the details page right sidebar.
936
-         *
937
-         * @since 1.0.0
938
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
939
-         */
940
-        do_action('geodir_sidebar_right_close', 'details-page');
941
-    }
929
+		/** This action is documented in geodirectory_template_actions.php */
930
+		do_action('geodir_detail_sidebar_inside');
931
+		?></div><!-- end geodir-content-right --><?php
932
+		/**
933
+		 * Called after the details page right sidebar.
934
+		 *
935
+		 * This is used to add closing wrapper HTML to the details page right sidebar.
936
+		 *
937
+		 * @since 1.0.0
938
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
939
+		 */
940
+		do_action('geodir_sidebar_right_close', 'details-page');
941
+	}
942 942
 }
943 943
 
944 944
 add_action('geodir_page_title', 'geodir_action_page_title', 10);
@@ -952,21 +952,21 @@  discard block
 block discarded – undo
952 952
  */
953 953
 function geodir_action_page_title()
954 954
 {
955
-    /**
956
-     * Filter the page title HTML h1 class.
957
-     *
958
-     * @since 1.0.0
959
-     * @param string $class The class to use. Default is 'entry-title fn'.
960
-     */
961
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
962
-    /**
963
-     * Filter the page title HTML header wrapper class.
964
-     *
965
-     * @since 1.0.0
966
-     * @param string $class The class to use. Default is 'entry-header'.
967
-     */
968
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
969
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
955
+	/**
956
+	 * Filter the page title HTML h1 class.
957
+	 *
958
+	 * @since 1.0.0
959
+	 * @param string $class The class to use. Default is 'entry-title fn'.
960
+	 */
961
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
962
+	/**
963
+	 * Filter the page title HTML header wrapper class.
964
+	 *
965
+	 * @since 1.0.0
966
+	 * @param string $class The class to use. Default is 'entry-header'.
967
+	 */
968
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
969
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
970 970
 }
971 971
 
972 972
 
@@ -983,94 +983,94 @@  discard block
 block discarded – undo
983 983
  */
984 984
 function geodir_action_details_slider()
985 985
 {
986
-    global $preview, $post;
986
+	global $preview, $post;
987 987
 
988
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
988
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
989 989
 
990
-    if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
991
-        $preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
990
+	if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
991
+		$preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
992 992
 
993
-        $preview_post_images = array();
994
-        if ($preview_get_images) {
995
-            foreach ($preview_get_images as $row) {
996
-                $preview_post_images[] = $row->src;
997
-            }
998
-        }
999
-        if (!empty($preview_post_images)) {
1000
-            $post->post_images = implode(',', $preview_post_images);
1001
-        }
1002
-    }
1003
-
1004
-    if ($preview) {
1005
-        $post_images = array();
1006
-        if (isset($post->post_images) && !empty($post->post_images)) {
1007
-            $post->post_images = trim($post->post_images, ",");
1008
-            $post_images = explode(",", $post->post_images);
1009
-        }
1010
-
1011
-        $main_slides = '';
1012
-        $nav_slides = '';
1013
-        $slides = 0;
1014
-
1015
-        if (!empty($post_images)) {
1016
-            foreach ($post_images as $image) {
1017
-                if (!empty($image)) {
1018
-                    $sizes = getimagesize(trim($image));
1019
-                    $width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1020
-                    $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1021
-
1022
-                    if ($image && $width && $height) {
1023
-                        $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1024
-                    }
1025
-
1026
-                    if (isset($image->src)) {
1027
-                        if ($image->height >= 400) {
1028
-                            $spacer_height = 0;
1029
-                        } else {
1030
-                            $spacer_height = ((400 - $image->height) / 2);
1031
-                        }
1032
-
1033
-                        $image_title = isset($image->title) ? $image->title : '';
1034
-
1035
-                        $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1036
-                        $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1037
-                        $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1038
-                        $slides++;
1039
-                    }
1040
-                }
1041
-            }// endfore
1042
-        } //end if
1043
-    } else {
1044
-        $main_slides = '';
1045
-        $nav_slides = '';
1046
-        /**
1047
-         * Filter if default images should show on the details page.
1048
-         *
1049
-         * @param bool $use_default_image Default false.
1050
-         * @since 1.6.16
1051
-         */
1052
-        $use_default_image = apply_filters('geodir_details_default_image_show', false);
1053
-        $post_images = geodir_get_images($post->ID, 'thumbnail', $use_default_image); // Hide default image on listing preview/detail page.
1054
-        $slides = 0;
1055
-
1056
-        if (!empty($post_images)) {
1057
-            foreach ($post_images as $image) {
1058
-                if ($image->height >= 400) {
1059
-                    $spacer_height = 0;
1060
-                } else {
1061
-                    $spacer_height = ((400 - $image->height) / 2);
1062
-                }
1063
-                $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1064
-                $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1065
-                $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1066
-                $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1067
-                $slides++;
1068
-            }
1069
-        }// endfore
1070
-    }
993
+		$preview_post_images = array();
994
+		if ($preview_get_images) {
995
+			foreach ($preview_get_images as $row) {
996
+				$preview_post_images[] = $row->src;
997
+			}
998
+		}
999
+		if (!empty($preview_post_images)) {
1000
+			$post->post_images = implode(',', $preview_post_images);
1001
+		}
1002
+	}
1003
+
1004
+	if ($preview) {
1005
+		$post_images = array();
1006
+		if (isset($post->post_images) && !empty($post->post_images)) {
1007
+			$post->post_images = trim($post->post_images, ",");
1008
+			$post_images = explode(",", $post->post_images);
1009
+		}
1010
+
1011
+		$main_slides = '';
1012
+		$nav_slides = '';
1013
+		$slides = 0;
1014
+
1015
+		if (!empty($post_images)) {
1016
+			foreach ($post_images as $image) {
1017
+				if (!empty($image)) {
1018
+					$sizes = getimagesize(trim($image));
1019
+					$width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1020
+					$height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1021
+
1022
+					if ($image && $width && $height) {
1023
+						$image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1024
+					}
1025
+
1026
+					if (isset($image->src)) {
1027
+						if ($image->height >= 400) {
1028
+							$spacer_height = 0;
1029
+						} else {
1030
+							$spacer_height = ((400 - $image->height) / 2);
1031
+						}
1032
+
1033
+						$image_title = isset($image->title) ? $image->title : '';
1034
+
1035
+						$main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1036
+						$main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1037
+						$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1038
+						$slides++;
1039
+					}
1040
+				}
1041
+			}// endfore
1042
+		} //end if
1043
+	} else {
1044
+		$main_slides = '';
1045
+		$nav_slides = '';
1046
+		/**
1047
+		 * Filter if default images should show on the details page.
1048
+		 *
1049
+		 * @param bool $use_default_image Default false.
1050
+		 * @since 1.6.16
1051
+		 */
1052
+		$use_default_image = apply_filters('geodir_details_default_image_show', false);
1053
+		$post_images = geodir_get_images($post->ID, 'thumbnail', $use_default_image); // Hide default image on listing preview/detail page.
1054
+		$slides = 0;
1055
+
1056
+		if (!empty($post_images)) {
1057
+			foreach ($post_images as $image) {
1058
+				if ($image->height >= 400) {
1059
+					$spacer_height = 0;
1060
+				} else {
1061
+					$spacer_height = ((400 - $image->height) / 2);
1062
+				}
1063
+				$caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1064
+				$main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1065
+				$main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1066
+				$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1067
+				$slides++;
1068
+			}
1069
+		}// endfore
1070
+	}
1071 1071
 
1072
-    if (!empty($post_images)) {
1073
-        ?>
1072
+	if (!empty($post_images)) {
1073
+		?>
1074 1074
         <div class="geodir_flex-container">
1075 1075
             <div class="geodir_flex-loader"><i class="fa fa-refresh fa-spin"></i></div>
1076 1076
             <div id="geodir_slider" class="geodir_flexslider ">
@@ -1083,7 +1083,7 @@  discard block
 block discarded – undo
1083 1083
             <?php } ?>
1084 1084
         </div>
1085 1085
     <?php
1086
-    }
1086
+	}
1087 1087
 }
1088 1088
 
1089 1089
 add_action('geodir_details_taxonomies', 'geodir_action_details_taxonomies', 10);
@@ -1098,177 +1098,177 @@  discard block
 block discarded – undo
1098 1098
  */
1099 1099
 function geodir_action_details_taxonomies()
1100 1100
 {
1101
-    global $preview, $post;?>
1101
+	global $preview, $post;?>
1102 1102
     <p class="geodir_post_taxomomies clearfix">
1103 1103
     <?php
1104
-    $taxonomies = array();
1105
-
1106
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
1107
-
1108
-    if ($preview && !$is_backend_preview) {
1109
-        $post_type = $post->listing_type;
1110
-        $post_taxonomy = $post_type . 'category';
1111
-        $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1112
-    } else {
1113
-        $post_type = $post->post_type;
1114
-        $post_taxonomy = $post_type . 'category';
1115
-    }
1104
+	$taxonomies = array();
1105
+
1106
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
1107
+
1108
+	if ($preview && !$is_backend_preview) {
1109
+		$post_type = $post->listing_type;
1110
+		$post_taxonomy = $post_type . 'category';
1111
+		$post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1112
+	} else {
1113
+		$post_type = $post->post_type;
1114
+		$post_taxonomy = $post_type . 'category';
1115
+	}
1116 1116
 //{	
1117
-    $post_type_info = get_post_type_object($post_type);
1118
-    $listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1119
-
1120
-    if (!empty($post->post_tags)) {
1121
-
1122
-        if (taxonomy_exists($post_type . '_tags')):
1123
-            $links = array();
1124
-            $terms = array();
1125
-            // to limit post tags
1126
-            $post_tags = trim($post->post_tags, ",");
1127
-            $post_id = isset($post->ID) ? $post->ID : '';
1128
-            /**
1129
-             * Filter the post tags.
1130
-             *
1131
-             * Allows you to filter the post tags output on the details page of a post.
1132
-             *
1133
-             * @since 1.0.0
1134
-             * @param string $post_tags A comma seperated list of tags.
1135
-             * @param int $post_id The current post id.
1136
-             */
1137
-            $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1138
-
1139
-            $post->post_tags = $post_tags;
1140
-            $post_tags = explode(",", trim($post->post_tags, ","));
1141
-
1142
-
1143
-            foreach ($post_tags as $post_term) {
1144
-
1145
-                // fix slug creation order for tags & location
1146
-                $post_term = trim($post_term);
1147
-
1148
-                $priority_location = false;
1149
-                if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1150
-                    $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1151
-                } else {
1152
-                    $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1153
-                    $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1154
-                    $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1155
-                    $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1156
-                    $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1157
-                    $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1158
-                    if ($match_country || $match_region || $match_city) {
1159
-                        $priority_location = true;
1160
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1161
-                    } else {
1162
-                        $insert_term = wp_insert_term($post_term, $post_type . '_tags');
1163
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1164
-                    }
1165
-                }
1166
-
1167
-                if (!is_wp_error($term) && is_object($term)) {
1168
-
1169
-                    // fix tag link on detail page
1170
-                    if ($priority_location) {
1171
-
1172
-                        $tag_link = "<a href=''>$post_term</a>";
1173
-                        /**
1174
-                         * Filter the tag name on the details page.
1175
-                         *
1176
-                         * @since 1.5.6
1177
-                         * @param string $tag_link The tag link html.
1178
-                         * @param object $term The tag term object.
1179
-                         */
1180
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1181
-                        $links[] = $tag_link;
1182
-                    } else {
1183
-                        $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1184
-                        /** This action is documented in geodirectory-template_actions.php */
1185
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1186
-                        $links[] = $tag_link;
1187
-                    }
1188
-                    $terms[] = $term;
1189
-                }
1190
-                //
1191
-            }
1192
-            if (!isset($listing_label)) {
1193
-                $listing_label = '';
1194
-            }
1195
-            $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1196
-        endif;
1197
-
1198
-    }
1199
-
1200
-    if (!empty($post->{$post_taxonomy})) {
1201
-        $links = array();
1202
-        $terms = array();
1203
-        $termsOrdered = array();
1204
-        if (!is_array($post->{$post_taxonomy})) {
1205
-            $post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1206
-        } else {
1207
-            $post_term = $post->{$post_taxonomy};
1117
+	$post_type_info = get_post_type_object($post_type);
1118
+	$listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1119
+
1120
+	if (!empty($post->post_tags)) {
1121
+
1122
+		if (taxonomy_exists($post_type . '_tags')):
1123
+			$links = array();
1124
+			$terms = array();
1125
+			// to limit post tags
1126
+			$post_tags = trim($post->post_tags, ",");
1127
+			$post_id = isset($post->ID) ? $post->ID : '';
1128
+			/**
1129
+			 * Filter the post tags.
1130
+			 *
1131
+			 * Allows you to filter the post tags output on the details page of a post.
1132
+			 *
1133
+			 * @since 1.0.0
1134
+			 * @param string $post_tags A comma seperated list of tags.
1135
+			 * @param int $post_id The current post id.
1136
+			 */
1137
+			$post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1138
+
1139
+			$post->post_tags = $post_tags;
1140
+			$post_tags = explode(",", trim($post->post_tags, ","));
1141
+
1142
+
1143
+			foreach ($post_tags as $post_term) {
1144
+
1145
+				// fix slug creation order for tags & location
1146
+				$post_term = trim($post_term);
1147
+
1148
+				$priority_location = false;
1149
+				if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1150
+					$term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1151
+				} else {
1152
+					$post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1153
+					$post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1154
+					$post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1155
+					$match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1156
+					$match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1157
+					$match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1158
+					if ($match_country || $match_region || $match_city) {
1159
+						$priority_location = true;
1160
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1161
+					} else {
1162
+						$insert_term = wp_insert_term($post_term, $post_type . '_tags');
1163
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1164
+					}
1165
+				}
1166
+
1167
+				if (!is_wp_error($term) && is_object($term)) {
1168
+
1169
+					// fix tag link on detail page
1170
+					if ($priority_location) {
1171
+
1172
+						$tag_link = "<a href=''>$post_term</a>";
1173
+						/**
1174
+						 * Filter the tag name on the details page.
1175
+						 *
1176
+						 * @since 1.5.6
1177
+						 * @param string $tag_link The tag link html.
1178
+						 * @param object $term The tag term object.
1179
+						 */
1180
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1181
+						$links[] = $tag_link;
1182
+					} else {
1183
+						$tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1184
+						/** This action is documented in geodirectory-template_actions.php */
1185
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1186
+						$links[] = $tag_link;
1187
+					}
1188
+					$terms[] = $term;
1189
+				}
1190
+				//
1191
+			}
1192
+			if (!isset($listing_label)) {
1193
+				$listing_label = '';
1194
+			}
1195
+			$taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1196
+		endif;
1197
+
1198
+	}
1199
+
1200
+	if (!empty($post->{$post_taxonomy})) {
1201
+		$links = array();
1202
+		$terms = array();
1203
+		$termsOrdered = array();
1204
+		if (!is_array($post->{$post_taxonomy})) {
1205
+			$post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1206
+		} else {
1207
+			$post_term = $post->{$post_taxonomy};
1208 1208
 			
1209 1209
 			if ($preview && !$is_backend_preview) {
1210 1210
 				$post_term = geodir_add_parent_terms($post_term, $post_taxonomy);
1211 1211
 			}
1212
-        }
1213
-
1214
-        $post_term = array_unique($post_term);
1215
-        if (!empty($post_term)) {
1216
-            foreach ($post_term as $post_term) {
1217
-                $post_term = trim($post_term);
1218
-
1219
-                if ($post_term != ''):
1220
-                    $term = get_term_by('id', $post_term, $post_taxonomy);
1221
-
1222
-                    if (is_object($term)) {
1223
-                        $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1224
-                        /**
1225
-                         * Filter the category name on the details page.
1226
-                         *
1227
-                         * @since 1.5.6
1228
-                         * @param string $term_link The link html to the category.
1229
-                         * @param object $term The category term object.
1230
-                         */
1231
-                        $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1232
-                        $links[] = $term_link;
1233
-                        $terms[] = $term;
1234
-                    }
1235
-                endif;
1236
-            }
1237
-            // order alphabetically
1238
-            asort($links);
1239
-            foreach (array_keys($links) as $key) {
1240
-                $termsOrdered[$key] = $terms[$key];
1241
-            }
1242
-            $terms = $termsOrdered;
1212
+		}
1213
+
1214
+		$post_term = array_unique($post_term);
1215
+		if (!empty($post_term)) {
1216
+			foreach ($post_term as $post_term) {
1217
+				$post_term = trim($post_term);
1218
+
1219
+				if ($post_term != ''):
1220
+					$term = get_term_by('id', $post_term, $post_taxonomy);
1221
+
1222
+					if (is_object($term)) {
1223
+						$term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1224
+						/**
1225
+						 * Filter the category name on the details page.
1226
+						 *
1227
+						 * @since 1.5.6
1228
+						 * @param string $term_link The link html to the category.
1229
+						 * @param object $term The category term object.
1230
+						 */
1231
+						$term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1232
+						$links[] = $term_link;
1233
+						$terms[] = $term;
1234
+					}
1235
+				endif;
1236
+			}
1237
+			// order alphabetically
1238
+			asort($links);
1239
+			foreach (array_keys($links) as $key) {
1240
+				$termsOrdered[$key] = $terms[$key];
1241
+			}
1242
+			$terms = $termsOrdered;
1243 1243
 
1244
-        }
1244
+		}
1245 1245
 
1246
-        if (!isset($listing_label)) {
1247
-            $listing_label = '';
1248
-        }
1249
-        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1246
+		if (!isset($listing_label)) {
1247
+			$listing_label = '';
1248
+		}
1249
+		$taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1250 1250
 
1251
-    }
1251
+	}
1252 1252
 
1253
-    /**
1254
-     * Filter the taxonomies array before output.
1255
-     *
1256
-     * @since 1.5.9
1257
-     * @param array $taxonomies The array of cats and tags.
1258
-     * @param string $post_type The post type being output.
1259
-     * @param string $listing_label The post type label.
1260
-     * @param string $listing_label The post type label with ucwords function.
1261
-     */
1262
-    $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1253
+	/**
1254
+	 * Filter the taxonomies array before output.
1255
+	 *
1256
+	 * @since 1.5.9
1257
+	 * @param array $taxonomies The array of cats and tags.
1258
+	 * @param string $post_type The post type being output.
1259
+	 * @param string $listing_label The post type label.
1260
+	 * @param string $listing_label The post type label with ucwords function.
1261
+	 */
1262
+	$taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1263 1263
 
1264
-    if (isset($taxonomies[$post_taxonomy])) {
1265
-        echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1266
-    }
1264
+	if (isset($taxonomies[$post_taxonomy])) {
1265
+		echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1266
+	}
1267 1267
 
1268
-    if (isset($taxonomies[$post_type . '_tags']))
1269
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1268
+	if (isset($taxonomies[$post_type . '_tags']))
1269
+		echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1270 1270
 
1271
-    ?>
1271
+	?>
1272 1272
     </p><?php
1273 1273
 }
1274 1274
 
@@ -1290,140 +1290,140 @@  discard block
 block discarded – undo
1290 1290
 function geodir_action_details_micordata($post='')
1291 1291
 {
1292 1292
 
1293
-    global $preview;
1294
-    if(empty($post)){global $post;}
1295
-    if ($preview || !geodir_is_page('detail')) {
1296
-        return;
1297
-    }
1298
-
1299
-    // url
1300
-    $c_url = geodir_curPageURL();
1301
-
1302
-    // post reviews
1303
-    $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1304
-    if (empty($post_reviews)) {
1305
-        $reviews = '';
1306
-    } else {
1307
-        foreach ($post_reviews as $review) {
1308
-            $reviews[] = array(
1309
-                "@type" => "Review",
1310
-                "author" => $review->comment_author,
1311
-                "datePublished" => $review->comment_date,
1312
-                "description" => $review->comment_content,
1313
-                "reviewRating" => array(
1314
-                    "@type" => "Rating",
1315
-                    "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1316
-                    "ratingValue" => geodir_get_commentoverall($review->comment_ID),
1317
-                    "worstRating" => "1"
1318
-                )
1319
-            );
1320
-        }
1321
-
1322
-    }
1323
-
1324
-    // post images
1325
-    $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1326
-    if (empty($post_images)) {
1327
-        $images = '';
1328
-    } else {
1329
-        $i_arr = array();
1330
-        foreach ($post_images as $img) {
1331
-            $i_arr[] = $img->src;
1332
-        }
1333
-
1334
-        if (count($i_arr) == 1) {
1335
-            $images = $i_arr[0];
1336
-        } else {
1337
-            $images = $i_arr;
1338
-        }
1339
-
1340
-    }
1341
-    //print_r($post);
1342
-    // external links
1343
-    $external_links =  array();
1344
-    $external_links[] = $post->geodir_website;
1345
-    $external_links[] = $post->geodir_twitter;
1346
-    $external_links[] = $post->geodir_facebook;
1347
-    $external_links = array_filter($external_links);
1348
-
1349
-    if(!empty($external_links)){
1350
-        $external_links = array_values($external_links);
1351
-    }
1352
-
1353
-    // reviews
1354
-    $comment_count = geodir_get_review_count_total($post->ID);
1355
-    $post_avgratings = geodir_get_post_rating($post->ID);
1356
-
1357
-    // schema type
1358
-    $schema_type = 'LocalBusiness';
1359
-    if(isset($post->default_category) && $post->default_category){
1360
-        $cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1361
-        if($cat_schema){$schema_type = $cat_schema;}
1362
-        if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1363
-    }
1364
-
1365
-    $schema = array();
1366
-    $schema['@context'] = "https://schema.org";
1367
-    $schema['@type'] = $schema_type;
1368
-    $schema['name'] = $post->post_title;
1369
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1370
-    $schema['telephone'] = $post->geodir_contact;
1371
-    $schema['url'] = $c_url;
1372
-    $schema['sameAs'] = $external_links;
1373
-    $schema['image'] = $images;
1374
-    $schema['address'] = array(
1375
-        "@type" => "PostalAddress",
1376
-        "streetAddress" => $post->post_address,
1377
-        "addressLocality" => $post->post_city,
1378
-        "addressRegion" => $post->post_region,
1379
-        "addressCountry" => $post->post_country,
1380
-        "postalCode" => $post->post_zip
1381
-    );
1382
-
1383
-    if($post->post_latitude && $post->post_longitude) {
1384
-        $schema['geo'] = array(
1385
-            "@type" => "GeoCoordinates",
1386
-            "latitude" => $post->post_latitude,
1387
-            "longitude" => $post->post_longitude
1388
-        );
1389
-    }
1390
-
1391
-    if($post_avgratings) {
1392
-        $schema['aggregateRating'] = array(
1393
-            "@type" => "AggregateRating",
1394
-            "ratingValue" => $post_avgratings,
1395
-            "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1396
-            "worstRating" => "1",
1397
-            "ratingCount" => $comment_count
1398
-        );
1399
-    }
1400
-    $schema['review'] = $reviews;
1401
-
1402
-    /**
1403
-     * Allow the schema JSON-LD info to be filtered.
1404
-     *
1405
-     * @since 1.5.4
1406
-     * @since 1.5.7 Added $post variable.
1407
-     * @param array $schema The array of schema data to be filtered.
1408
-     * @param object $post The post object.
1409
-     */
1410
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1411
-
1412
-
1413
-    echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1414
-
1415
-
1416
-    $uploads = wp_upload_dir();
1417
-    $facebook_og = (isset($post->featured_image) && $post->featured_image) ? '<meta property="og:image" content="'.$uploads['baseurl'].$post->featured_image.'"/>' : '';
1418
-
1419
-    /**
1420
-     * Show facebook open graph meta info
1421
-     *
1422
-     * @since 1.6.6
1423
-     * @param string $facebook_og The open graph html to be filtered.
1424
-     * @param object $post The post object.
1425
-     */
1426
-    echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1293
+	global $preview;
1294
+	if(empty($post)){global $post;}
1295
+	if ($preview || !geodir_is_page('detail')) {
1296
+		return;
1297
+	}
1298
+
1299
+	// url
1300
+	$c_url = geodir_curPageURL();
1301
+
1302
+	// post reviews
1303
+	$post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1304
+	if (empty($post_reviews)) {
1305
+		$reviews = '';
1306
+	} else {
1307
+		foreach ($post_reviews as $review) {
1308
+			$reviews[] = array(
1309
+				"@type" => "Review",
1310
+				"author" => $review->comment_author,
1311
+				"datePublished" => $review->comment_date,
1312
+				"description" => $review->comment_content,
1313
+				"reviewRating" => array(
1314
+					"@type" => "Rating",
1315
+					"bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1316
+					"ratingValue" => geodir_get_commentoverall($review->comment_ID),
1317
+					"worstRating" => "1"
1318
+				)
1319
+			);
1320
+		}
1321
+
1322
+	}
1323
+
1324
+	// post images
1325
+	$post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1326
+	if (empty($post_images)) {
1327
+		$images = '';
1328
+	} else {
1329
+		$i_arr = array();
1330
+		foreach ($post_images as $img) {
1331
+			$i_arr[] = $img->src;
1332
+		}
1333
+
1334
+		if (count($i_arr) == 1) {
1335
+			$images = $i_arr[0];
1336
+		} else {
1337
+			$images = $i_arr;
1338
+		}
1339
+
1340
+	}
1341
+	//print_r($post);
1342
+	// external links
1343
+	$external_links =  array();
1344
+	$external_links[] = $post->geodir_website;
1345
+	$external_links[] = $post->geodir_twitter;
1346
+	$external_links[] = $post->geodir_facebook;
1347
+	$external_links = array_filter($external_links);
1348
+
1349
+	if(!empty($external_links)){
1350
+		$external_links = array_values($external_links);
1351
+	}
1352
+
1353
+	// reviews
1354
+	$comment_count = geodir_get_review_count_total($post->ID);
1355
+	$post_avgratings = geodir_get_post_rating($post->ID);
1356
+
1357
+	// schema type
1358
+	$schema_type = 'LocalBusiness';
1359
+	if(isset($post->default_category) && $post->default_category){
1360
+		$cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1361
+		if($cat_schema){$schema_type = $cat_schema;}
1362
+		if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1363
+	}
1364
+
1365
+	$schema = array();
1366
+	$schema['@context'] = "https://schema.org";
1367
+	$schema['@type'] = $schema_type;
1368
+	$schema['name'] = $post->post_title;
1369
+	$schema['description'] = wp_strip_all_tags( $post->post_content, true );
1370
+	$schema['telephone'] = $post->geodir_contact;
1371
+	$schema['url'] = $c_url;
1372
+	$schema['sameAs'] = $external_links;
1373
+	$schema['image'] = $images;
1374
+	$schema['address'] = array(
1375
+		"@type" => "PostalAddress",
1376
+		"streetAddress" => $post->post_address,
1377
+		"addressLocality" => $post->post_city,
1378
+		"addressRegion" => $post->post_region,
1379
+		"addressCountry" => $post->post_country,
1380
+		"postalCode" => $post->post_zip
1381
+	);
1382
+
1383
+	if($post->post_latitude && $post->post_longitude) {
1384
+		$schema['geo'] = array(
1385
+			"@type" => "GeoCoordinates",
1386
+			"latitude" => $post->post_latitude,
1387
+			"longitude" => $post->post_longitude
1388
+		);
1389
+	}
1390
+
1391
+	if($post_avgratings) {
1392
+		$schema['aggregateRating'] = array(
1393
+			"@type" => "AggregateRating",
1394
+			"ratingValue" => $post_avgratings,
1395
+			"bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1396
+			"worstRating" => "1",
1397
+			"ratingCount" => $comment_count
1398
+		);
1399
+	}
1400
+	$schema['review'] = $reviews;
1401
+
1402
+	/**
1403
+	 * Allow the schema JSON-LD info to be filtered.
1404
+	 *
1405
+	 * @since 1.5.4
1406
+	 * @since 1.5.7 Added $post variable.
1407
+	 * @param array $schema The array of schema data to be filtered.
1408
+	 * @param object $post The post object.
1409
+	 */
1410
+	$schema = apply_filters('geodir_details_schema', $schema,$post);
1411
+
1412
+
1413
+	echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1414
+
1415
+
1416
+	$uploads = wp_upload_dir();
1417
+	$facebook_og = (isset($post->featured_image) && $post->featured_image) ? '<meta property="og:image" content="'.$uploads['baseurl'].$post->featured_image.'"/>' : '';
1418
+
1419
+	/**
1420
+	 * Show facebook open graph meta info
1421
+	 *
1422
+	 * @since 1.6.6
1423
+	 * @param string $facebook_og The open graph html to be filtered.
1424
+	 * @param object $post The post object.
1425
+	 */
1426
+	echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1427 1427
 
1428 1428
 
1429 1429
 
@@ -1443,7 +1443,7 @@  discard block
 block discarded – undo
1443 1443
  */
1444 1444
 function geodir_action_details_next_prev()
1445 1445
 {
1446
-    ?>
1446
+	?>
1447 1447
     <div class="geodir-pos_navigation clearfix">
1448 1448
     <div
1449 1449
         class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
@@ -1461,15 +1461,15 @@  discard block
 block discarded – undo
1461 1461
  */
1462 1462
 function geodir_action_before_single_post()
1463 1463
 {
1464
-    global $post;
1465
-    /**
1466
-     * Called at the very start of the details page output, before the title section.
1467
-     *
1468
-     * @since 1.0.0
1469
-     * @param object $post The current post object.
1470
-     * @global WP_Post|null $post The current post, if available.
1471
-     */
1472
-    do_action('geodir_before_single_post', $post); // extra action	
1464
+	global $post;
1465
+	/**
1466
+	 * Called at the very start of the details page output, before the title section.
1467
+	 *
1468
+	 * @since 1.0.0
1469
+	 * @param object $post The current post object.
1470
+	 * @global WP_Post|null $post The current post, if available.
1471
+	 */
1472
+	do_action('geodir_before_single_post', $post); // extra action	
1473 1473
 }
1474 1474
 
1475 1475
 /**
@@ -1480,13 +1480,13 @@  discard block
 block discarded – undo
1480 1480
  */
1481 1481
 function geodir_action_after_single_post($post)
1482 1482
 {
1483
-    /**
1484
-     * Called on the details page after the details page tabs section and before the next/prev buttons.
1485
-     *
1486
-     * @since 1.0.0
1487
-     * @param object $post The current post object.
1488
-     */
1489
-    do_action('geodir_after_single_post', $post); // extra action	
1483
+	/**
1484
+	 * Called on the details page after the details page tabs section and before the next/prev buttons.
1485
+	 *
1486
+	 * @since 1.0.0
1487
+	 * @param object $post The current post object.
1488
+	 */
1489
+	do_action('geodir_after_single_post', $post); // extra action	
1490 1490
 }
1491 1491
 
1492 1492
 add_action('geodir_details_main_content', 'geodir_action_before_single_post', 10);
@@ -1512,168 +1512,168 @@  discard block
 block discarded – undo
1512 1512
  */
1513 1513
 function geodir_action_listings_title()
1514 1514
 {
1515
-    global $wp, $term;
1515
+	global $wp, $term;
1516 1516
 
1517
-    $gd_post_type = geodir_get_current_posttype();
1518
-    $post_type_info = get_post_type_object($gd_post_type);
1517
+	$gd_post_type = geodir_get_current_posttype();
1518
+	$post_type_info = get_post_type_object($gd_post_type);
1519 1519
 
1520
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
1521
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1522
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1523
-    }
1520
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
1521
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1522
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1523
+	}
1524 1524
 
1525
-    $list_title = $add_string_in_title . __($post_type_info->labels->name, 'geodirectory');
1526
-    $single_name = $post_type_info->labels->singular_name;
1525
+	$list_title = $add_string_in_title . __($post_type_info->labels->name, 'geodirectory');
1526
+	$single_name = $post_type_info->labels->singular_name;
1527 1527
 
1528
-    $taxonomy = geodir_get_taxonomies($gd_post_type, true);
1528
+	$taxonomy = geodir_get_taxonomies($gd_post_type, true);
1529 1529
 
1530
-    $gd_country = get_query_var('gd_country');
1531
-    $gd_region = get_query_var('gd_region');
1532
-    $gd_city = get_query_var('gd_city');
1530
+	$gd_country = get_query_var('gd_country');
1531
+	$gd_region = get_query_var('gd_region');
1532
+	$gd_city = get_query_var('gd_city');
1533 1533
 
1534
-    if (!empty($term)) {
1535
-        $location_name = '';
1536
-        if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1537
-            if ($gd_country != '') {
1538
-                $location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1539
-            }
1540
-
1541
-            if ($gd_region != '') {
1542
-                $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1543
-            }
1544
-
1545
-            if ($gd_city != '') {
1546
-                $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1547
-            }
1548
-        }
1549
-
1550
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
1551
-        if (!empty($current_term)) {
1552
-            $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1553
-            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1554
-                $location_last_char = substr($location_name, -1);
1555
-                $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1556
-                $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1557
-            } else {
1558
-                $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1559
-            }
1560
-        } else {
1561
-            if (count($taxonomy) > 1) {
1562
-                $current_term = get_term_by('slug', $term, $taxonomy[1]);
1563
-
1564
-                if (!empty($current_term)) {
1565
-                    $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1566
-                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1567
-                        $location_last_char = substr($location_name, -1);
1568
-                        $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1569
-                        $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1570
-                    } else {
1571
-                        $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1572
-                    }
1573
-                }
1574
-            }
1575
-        }
1576
-
1577
-    } else {
1578
-        $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1579
-        $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1580
-        $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1581
-
1582
-        $gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1583
-
1584
-        if (function_exists('get_actual_location_name')) {
1585
-            $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1586
-            $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1587
-            $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1588
-        }
1589
-
1590
-        if ($gd_city != '') {
1591
-            if ($gd_city_actual != '') {
1592
-                $gd_city = $gd_city_actual;
1593
-            } else {
1594
-                $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1595
-                $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1596
-                $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1597
-            }
1598
-
1599
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1600
-        } else if ($gd_region != '') {
1601
-            if ($gd_region_actual != '') {
1602
-                $gd_region = $gd_region_actual;
1603
-            } else {
1604
-                $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1605
-                $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1606
-                $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1607
-            }
1608
-
1609
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1610
-        } else if ($gd_country != '') {
1611
-            if ($gd_country_actual != '') {
1612
-                $gd_country = $gd_country_actual;
1613
-            } else {
1614
-                $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1615
-                $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1616
-                $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1617
-            }
1618
-
1619
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1620
-        }
1621
-    }
1622
-
1623
-    if (is_search()) {
1624
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1625
-    }
1626
-    /** This action is documented in geodirectory_template_actions.php */
1627
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
1628
-    /** This action is documented in geodirectory_template_actions.php */
1629
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1630
-
1631
-
1632
-    $title = $list_title;
1633
-    $gd_page = '';
1634
-    if(geodir_is_page('pt')){
1635
-        $gd_page = 'pt';
1636
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1637
-    }
1638
-    elseif(geodir_is_page('listing')){
1639
-        $gd_page = 'listing';
1640
-        global $wp_query;
1641
-        $current_term = $wp_query->get_queried_object();
1642
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1643
-            $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1644
-        }else{
1645
-            $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1646
-        }
1534
+	if (!empty($term)) {
1535
+		$location_name = '';
1536
+		if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1537
+			if ($gd_country != '') {
1538
+				$location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1539
+			}
1647 1540
 
1648
-    }
1649
-    elseif(geodir_is_page('author')){
1650
-        $gd_page = 'author';
1651
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1652
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1653
-        }else{
1654
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1655
-        }
1541
+			if ($gd_region != '') {
1542
+				$location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1543
+			}
1656 1544
 
1657
-    }
1545
+			if ($gd_city != '') {
1546
+				$location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1547
+			}
1548
+		}
1549
+
1550
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
1551
+		if (!empty($current_term)) {
1552
+			$current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1553
+			if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1554
+				$location_last_char = substr($location_name, -1);
1555
+				$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1556
+				$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1557
+			} else {
1558
+				$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1559
+			}
1560
+		} else {
1561
+			if (count($taxonomy) > 1) {
1562
+				$current_term = get_term_by('slug', $term, $taxonomy[1]);
1563
+
1564
+				if (!empty($current_term)) {
1565
+					$current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1566
+					if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1567
+						$location_last_char = substr($location_name, -1);
1568
+						$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1569
+						$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1570
+					} else {
1571
+						$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1572
+					}
1573
+				}
1574
+			}
1575
+		}
1576
+
1577
+	} else {
1578
+		$gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1579
+		$gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1580
+		$gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1581
+
1582
+		$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1583
+
1584
+		if (function_exists('get_actual_location_name')) {
1585
+			$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1586
+			$gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1587
+			$gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1588
+		}
1589
+
1590
+		if ($gd_city != '') {
1591
+			if ($gd_city_actual != '') {
1592
+				$gd_city = $gd_city_actual;
1593
+			} else {
1594
+				$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1595
+				$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1596
+				$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1597
+			}
1658 1598
 
1599
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1600
+		} else if ($gd_region != '') {
1601
+			if ($gd_region_actual != '') {
1602
+				$gd_region = $gd_region_actual;
1603
+			} else {
1604
+				$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1605
+				$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1606
+				$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1607
+			}
1659 1608
 
1660
-    /**
1661
-     * Filter page title to replace variables.
1662
-     *
1663
-     * @since 1.5.4
1664
-     * @param string $title The page title including variables.
1665
-     * @param string $gd_page The GeoDirectory page type if any.
1666
-     */
1667
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1609
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1610
+		} else if ($gd_country != '') {
1611
+			if ($gd_country_actual != '') {
1612
+				$gd_country = $gd_country_actual;
1613
+			} else {
1614
+				$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1615
+				$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1616
+				$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1617
+			}
1668 1618
 
1669
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1670
-        /**
1671
-         * Filter the listing page title.
1672
-         *
1673
-         * @since 1.0.0
1674
-         * @param string $list_title The title for the category page.
1675
-         */
1676
-        apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1619
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1620
+		}
1621
+	}
1622
+
1623
+	if (is_search()) {
1624
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1625
+	}
1626
+	/** This action is documented in geodirectory_template_actions.php */
1627
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
1628
+	/** This action is documented in geodirectory_template_actions.php */
1629
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1630
+
1631
+
1632
+	$title = $list_title;
1633
+	$gd_page = '';
1634
+	if(geodir_is_page('pt')){
1635
+		$gd_page = 'pt';
1636
+		$title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1637
+	}
1638
+	elseif(geodir_is_page('listing')){
1639
+		$gd_page = 'listing';
1640
+		global $wp_query;
1641
+		$current_term = $wp_query->get_queried_object();
1642
+		if (strpos($current_term->taxonomy,'_tags') !== false) {
1643
+			$title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1644
+		}else{
1645
+			$title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1646
+		}
1647
+
1648
+	}
1649
+	elseif(geodir_is_page('author')){
1650
+		$gd_page = 'author';
1651
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1652
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1653
+		}else{
1654
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1655
+		}
1656
+
1657
+	}
1658
+
1659
+
1660
+	/**
1661
+	 * Filter page title to replace variables.
1662
+	 *
1663
+	 * @since 1.5.4
1664
+	 * @param string $title The page title including variables.
1665
+	 * @param string $gd_page The GeoDirectory page type if any.
1666
+	 */
1667
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1668
+
1669
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1670
+		/**
1671
+		 * Filter the listing page title.
1672
+		 *
1673
+		 * @since 1.0.0
1674
+		 * @param string $list_title The title for the category page.
1675
+		 */
1676
+		apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1677 1677
 }
1678 1678
 
1679 1679
 add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
@@ -1686,46 +1686,46 @@  discard block
 block discarded – undo
1686 1686
  */
1687 1687
 function geodir_action_listings_description()
1688 1688
 {
1689
-    global $wp_query;
1690
-    $current_term = $wp_query->get_queried_object();
1689
+	global $wp_query;
1690
+	$current_term = $wp_query->get_queried_object();
1691 1691
 
1692
-    $gd_post_type = geodir_get_current_posttype();
1693
-    if (isset($current_term->term_id) && $current_term->term_id != '') {
1692
+	$gd_post_type = geodir_get_current_posttype();
1693
+	if (isset($current_term->term_id) && $current_term->term_id != '') {
1694 1694
 
1695
-        $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1696
-        $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1697
-        if ($term_desc && !$saved_data) {
1698
-            $saved_data = $term_desc;
1699
-        }
1695
+		$term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1696
+		$saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1697
+		if ($term_desc && !$saved_data) {
1698
+			$saved_data = $term_desc;
1699
+		}
1700 1700
 
1701
-        // stop payment manager filtering content length
1702
-        $filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1703
-        if ( false !== $filter_priority ) {
1704
-            remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1705
-        }
1701
+		// stop payment manager filtering content length
1702
+		$filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1703
+		if ( false !== $filter_priority ) {
1704
+			remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1705
+		}
1706 1706
 
1707
-        /**
1708
-         * Apply the core filter `the_content` filter to the variable string.
1709
-         *
1710
-         * This is a WordPress core filter that does many things.
1711
-         *
1712
-         * @since 1.0.0
1713
-         * @param string $var The string to apply the filter to.
1714
-         */
1715
-        $cat_description = apply_filters('the_content', $saved_data);
1707
+		/**
1708
+		 * Apply the core filter `the_content` filter to the variable string.
1709
+		 *
1710
+		 * This is a WordPress core filter that does many things.
1711
+		 *
1712
+		 * @since 1.0.0
1713
+		 * @param string $var The string to apply the filter to.
1714
+		 */
1715
+		$cat_description = apply_filters('the_content', $saved_data);
1716 1716
 
1717 1717
 
1718
-        if ( false !== $filter_priority ) {
1719
-            add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1720
-        }
1718
+		if ( false !== $filter_priority ) {
1719
+			add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1720
+		}
1721 1721
 
1722
-        if ($cat_description) {
1723
-            ?>
1722
+		if ($cat_description) {
1723
+			?>
1724 1724
 
1725 1725
             <div class="term_description"><?php echo $cat_description;?></div> <?php
1726
-        }
1726
+		}
1727 1727
 
1728
-    }
1728
+	}
1729 1729
 }
1730 1730
 
1731 1731
 // action for adding the listings page top widget area
@@ -1744,11 +1744,11 @@  discard block
 block discarded – undo
1744 1744
  */
1745 1745
 function geodir_action_geodir_sidebar_listings_top()
1746 1746
 {
1747
-    if (get_option('geodir_show_listing_top_section')) { ?>
1747
+	if (get_option('geodir_show_listing_top_section')) { ?>
1748 1748
         <div
1749 1749
             class="<?php
1750
-            /** This action is documented in geodirectory_template_actions.php */
1751
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1750
+			/** This action is documented in geodirectory_template_actions.php */
1751
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1752 1752
             <?php dynamic_sidebar('geodir_listing_top'); ?>
1753 1753
         </div><!-- clearfix ends here-->
1754 1754
     <?php }
@@ -1771,35 +1771,35 @@  discard block
 block discarded – undo
1771 1771
  */
1772 1772
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1773 1773
 {
1774
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1775
-        $width_css = 'style="width:' . $width . '%;"';
1776
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1777
-        $width_css = 'style="width:' . $width . '%;"';
1778
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1779
-        $width_css = 'style="width:' . $width . '%;"';
1780
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1781
-        $width_css = 'style="width:' . $width . '%;"';
1782
-    } else {
1783
-        $width_css = '';
1784
-    }
1785
-
1786
-    $tc = get_option('theme_compatibility_setting');
1787
-    if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1788
-        $text = $tc['geodir_sidebar_left_open_replace'];
1789
-    } else {
1790
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1791
-    }
1792
-
1793
-    if (!empty($tc['geodir_sidebar_left_open_id'])) {
1794
-        $id = $tc['geodir_sidebar_left_open_id'];
1795
-    }
1796
-    if (!empty($tc['geodir_sidebar_left_open_class'])) {
1797
-        $class = $tc['geodir_sidebar_left_open_class'];
1798
-    }
1799
-
1800
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1801
-
1802
-    echo $text;
1774
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1775
+		$width_css = 'style="width:' . $width . '%;"';
1776
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1777
+		$width_css = 'style="width:' . $width . '%;"';
1778
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1779
+		$width_css = 'style="width:' . $width . '%;"';
1780
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1781
+		$width_css = 'style="width:' . $width . '%;"';
1782
+	} else {
1783
+		$width_css = '';
1784
+	}
1785
+
1786
+	$tc = get_option('theme_compatibility_setting');
1787
+	if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1788
+		$text = $tc['geodir_sidebar_left_open_replace'];
1789
+	} else {
1790
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1791
+	}
1792
+
1793
+	if (!empty($tc['geodir_sidebar_left_open_id'])) {
1794
+		$id = $tc['geodir_sidebar_left_open_id'];
1795
+	}
1796
+	if (!empty($tc['geodir_sidebar_left_open_class'])) {
1797
+		$class = $tc['geodir_sidebar_left_open_class'];
1798
+	}
1799
+
1800
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1801
+
1802
+	echo $text;
1803 1803
 }
1804 1804
 
1805 1805
 // action for adding the primary div closing tag
@@ -1815,13 +1815,13 @@  discard block
 block discarded – undo
1815 1815
  */
1816 1816
 function geodir_action_sidebar_left_close($type = '')
1817 1817
 {
1818
-    $tc = get_option('theme_compatibility_setting');
1819
-    if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1820
-        $text = $tc['geodir_sidebar_left_close_replace'];
1821
-    } else {
1822
-        $text = '</aside><!-- sidebar ends here-->';
1823
-    }
1824
-    echo $text;
1818
+	$tc = get_option('theme_compatibility_setting');
1819
+	if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1820
+		$text = $tc['geodir_sidebar_left_close_replace'];
1821
+	} else {
1822
+		$text = '</aside><!-- sidebar ends here-->';
1823
+	}
1824
+	echo $text;
1825 1825
 }
1826 1826
 
1827 1827
 /**
@@ -1834,7 +1834,7 @@  discard block
 block discarded – undo
1834 1834
  */
1835 1835
 function geodir_listing_left_section()
1836 1836
 {
1837
-    if (get_option('geodir_show_listing_left_section')) { ?>
1837
+	if (get_option('geodir_show_listing_left_section')) { ?>
1838 1838
         <div class="geodir-content-left geodir-sidebar-wrap">
1839 1839
             <?php dynamic_sidebar('geodir_listing_left_sidebar'); ?>
1840 1840
         </div><!-- end geodir-content-left -->
@@ -1852,20 +1852,20 @@  discard block
 block discarded – undo
1852 1852
  */
1853 1853
 function geodir_action_listings_sidebar_left()
1854 1854
 {
1855
-    if (get_option('geodir_show_listing_left_section')) {
1856
-        /** This action is documented in geodirectory_template_actions.php */
1857
-        do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'https://schema.org/WPSideBar');
1858
-        /**
1859
-         * Calls the listings page (category) left sidebar content.
1860
-         *
1861
-         * All the content for the listings page left sidebar is added via this hook.
1862
-         *
1863
-         * @since 1.0.0
1864
-         */
1865
-        do_action('geodir_listings_sidebar_left_inside');
1866
-        /** This action is documented in geodirectory_template_actions.php */
1867
-        do_action('geodir_sidebar_left_close', 'listings-page');
1868
-    }
1855
+	if (get_option('geodir_show_listing_left_section')) {
1856
+		/** This action is documented in geodirectory_template_actions.php */
1857
+		do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'https://schema.org/WPSideBar');
1858
+		/**
1859
+		 * Calls the listings page (category) left sidebar content.
1860
+		 *
1861
+		 * All the content for the listings page left sidebar is added via this hook.
1862
+		 *
1863
+		 * @since 1.0.0
1864
+		 */
1865
+		do_action('geodir_listings_sidebar_left_inside');
1866
+		/** This action is documented in geodirectory_template_actions.php */
1867
+		do_action('geodir_sidebar_left_close', 'listings-page');
1868
+	}
1869 1869
 }
1870 1870
 
1871 1871
 /**
@@ -1878,7 +1878,7 @@  discard block
 block discarded – undo
1878 1878
  */
1879 1879
 function geodir_listing_right_section()
1880 1880
 {
1881
-    if (get_option('geodir_show_listing_right_section')) { ?>
1881
+	if (get_option('geodir_show_listing_right_section')) { ?>
1882 1882
         <div class="geodir-content-right geodir-sidebar-wrap">
1883 1883
             <?php dynamic_sidebar('geodir_listing_right_sidebar'); ?>
1884 1884
         </div><!-- end geodir-content-right -->
@@ -1896,20 +1896,20 @@  discard block
 block discarded – undo
1896 1896
  */
1897 1897
 function geodir_action_listings_sidebar_right()
1898 1898
 {
1899
-    if (get_option('geodir_show_listing_right_section')) {
1900
-        /** This action is documented in geodirectory_template_actions.php */
1901
-        do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1902
-        /**
1903
-         * Calls the listings page (category) right sidebar content.
1904
-         *
1905
-         * All the content for the listings page right sidebar is added via this hook.
1906
-         *
1907
-         * @since 1.0.0
1908
-         */
1909
-        do_action('geodir_listings_sidebar_right_inside');
1910
-        /** This action is documented in geodirectory_template_actions.php */
1911
-        do_action('geodir_sidebar_right_close', 'listings-page');
1912
-    }
1899
+	if (get_option('geodir_show_listing_right_section')) {
1900
+		/** This action is documented in geodirectory_template_actions.php */
1901
+		do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1902
+		/**
1903
+		 * Calls the listings page (category) right sidebar content.
1904
+		 *
1905
+		 * All the content for the listings page right sidebar is added via this hook.
1906
+		 *
1907
+		 * @since 1.0.0
1908
+		 */
1909
+		do_action('geodir_listings_sidebar_right_inside');
1910
+		/** This action is documented in geodirectory_template_actions.php */
1911
+		do_action('geodir_sidebar_right_close', 'listings-page');
1912
+	}
1913 1913
 }
1914 1914
 
1915 1915
 
@@ -1926,23 +1926,23 @@  discard block
 block discarded – undo
1926 1926
  */
1927 1927
 function geodir_action_main_content_open($type = '', $id = '', $class = '')
1928 1928
 {
1929
-    $tc = get_option('theme_compatibility_setting');
1930
-    if (!empty($tc['geodir_main_content_open_replace'])) {
1931
-        $text = $tc['geodir_main_content_open_replace'];
1932
-    } else {
1933
-        $text = '<main id="[id]" class="[class]" role="main">';
1934
-    }
1929
+	$tc = get_option('theme_compatibility_setting');
1930
+	if (!empty($tc['geodir_main_content_open_replace'])) {
1931
+		$text = $tc['geodir_main_content_open_replace'];
1932
+	} else {
1933
+		$text = '<main id="[id]" class="[class]" role="main">';
1934
+	}
1935 1935
 
1936
-    if (!empty($tc['geodir_main_content_open_id'])) {
1937
-        $id = $tc['geodir_main_content_open_id'];
1938
-    }
1939
-    if (!empty($tc['geodir_main_content_open_class'])) {
1940
-        $class = $tc['geodir_main_content_open_class'];
1941
-    }
1936
+	if (!empty($tc['geodir_main_content_open_id'])) {
1937
+		$id = $tc['geodir_main_content_open_id'];
1938
+	}
1939
+	if (!empty($tc['geodir_main_content_open_class'])) {
1940
+		$class = $tc['geodir_main_content_open_class'];
1941
+	}
1942 1942
 
1943
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1943
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1944 1944
 
1945
-    echo $text;
1945
+	echo $text;
1946 1946
 }
1947 1947
 
1948 1948
 // action for adding the primary div closing tag
@@ -1955,13 +1955,13 @@  discard block
 block discarded – undo
1955 1955
  */
1956 1956
 function geodir_action_main_content_close()
1957 1957
 {
1958
-    $tc = get_option('theme_compatibility_setting');
1959
-    if (!empty($tc['geodir_main_content_close_replace'])) {
1960
-        $text = $tc['geodir_main_content_close_replace'];
1961
-    } else {
1962
-        $text = '</main><!-- main ends here-->';
1963
-    }
1964
-    echo $text;
1958
+	$tc = get_option('theme_compatibility_setting');
1959
+	if (!empty($tc['geodir_main_content_close_replace'])) {
1960
+		$text = $tc['geodir_main_content_close_replace'];
1961
+	} else {
1962
+		$text = '</main><!-- main ends here-->';
1963
+	}
1964
+	echo $text;
1965 1965
 }
1966 1966
 
1967 1967
 /**
@@ -1973,14 +1973,14 @@  discard block
 block discarded – undo
1973 1973
  */
1974 1974
 function geodir_action_listings_content_inside()
1975 1975
 {
1976
-    global $gridview_columns;
1977
-    $listing_view = get_option('geodir_listing_view');
1978
-    if (strstr($listing_view, 'gridview')) {
1979
-        $gridview_columns = $listing_view;
1980
-        $listing_view_exp = explode('_', $listing_view);
1981
-        $listing_view = $listing_view_exp[0];
1982
-    }
1983
-    geodir_get_template_part('listing', 'listview');
1976
+	global $gridview_columns;
1977
+	$listing_view = get_option('geodir_listing_view');
1978
+	if (strstr($listing_view, 'gridview')) {
1979
+		$gridview_columns = $listing_view;
1980
+		$listing_view_exp = explode('_', $listing_view);
1981
+		$listing_view = $listing_view_exp[0];
1982
+	}
1983
+	geodir_get_template_part('listing', 'listview');
1984 1984
 }
1985 1985
 
1986 1986
 add_action('geodir_listings_content_inside', 'geodir_action_listings_content_inside', 10);
@@ -1996,47 +1996,47 @@  discard block
 block discarded – undo
1996 1996
  */
1997 1997
 function geodir_action_listings_content()
1998 1998
 {
1999
-    /**
2000
-     * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
2001
-     *
2002
-     * @since 1.0.0
2003
-     * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
2004
-     * @param string $id The id for the div. Usually 'geodir-main-content'.
2005
-     * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
2006
-     * @see 'geodir_main_content_close' Where the oposing closing tag is added.
2007
-     */
2008
-    do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
2009
-    $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
2010
-    echo '<div class="clearfix '.$extra_class.'">';
2011
-    /**
2012
-     * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
2013
-     *
2014
-     * @since 1.0.0
2015
-     */
2016
-    do_action('geodir_before_listing');
2017
-    echo '</div>';
2018
-
2019
-    /**
2020
-     * This actions calls the listings list content. Used on listings pages and search and author pages.
2021
-     *
2022
-     * @since 1.0.0
2023
-     */
2024
-    do_action('geodir_listings_content_inside');
2025
-
2026
-    /**
2027
-     * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2028
-     *
2029
-     * @since 1.0.0
2030
-     */
2031
-    do_action('geodir_after_listing');
2032
-
2033
-    /**
2034
-     * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2035
-     *
2036
-     * @since 1.0.0
2037
-     * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2038
-     */
2039
-    do_action('geodir_main_content_close', 'listings-page');
1999
+	/**
2000
+	 * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
2001
+	 *
2002
+	 * @since 1.0.0
2003
+	 * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
2004
+	 * @param string $id The id for the div. Usually 'geodir-main-content'.
2005
+	 * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
2006
+	 * @see 'geodir_main_content_close' Where the oposing closing tag is added.
2007
+	 */
2008
+	do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
2009
+	$extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
2010
+	echo '<div class="clearfix '.$extra_class.'">';
2011
+	/**
2012
+	 * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
2013
+	 *
2014
+	 * @since 1.0.0
2015
+	 */
2016
+	do_action('geodir_before_listing');
2017
+	echo '</div>';
2018
+
2019
+	/**
2020
+	 * This actions calls the listings list content. Used on listings pages and search and author pages.
2021
+	 *
2022
+	 * @since 1.0.0
2023
+	 */
2024
+	do_action('geodir_listings_content_inside');
2025
+
2026
+	/**
2027
+	 * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2028
+	 *
2029
+	 * @since 1.0.0
2030
+	 */
2031
+	do_action('geodir_after_listing');
2032
+
2033
+	/**
2034
+	 * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2035
+	 *
2036
+	 * @since 1.0.0
2037
+	 * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2038
+	 */
2039
+	do_action('geodir_main_content_close', 'listings-page');
2040 2040
 }
2041 2041
 
2042 2042
 
@@ -2051,10 +2051,10 @@  discard block
 block discarded – undo
2051 2051
  */
2052 2052
 function geodir_action_sidebar_listings_bottom_section()
2053 2053
 {
2054
-    if (get_option('geodir_show_listing_bottom_section')) { ?>
2054
+	if (get_option('geodir_show_listing_bottom_section')) { ?>
2055 2055
         <div class="<?php
2056
-            /** This action is documented in geodirectory_template_actions.php */
2057
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2056
+			/** This action is documented in geodirectory_template_actions.php */
2057
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2058 2058
             <?php dynamic_sidebar('geodir_listing_bottom'); ?>
2059 2059
         </div><!-- clearfix ends here-->
2060 2060
     <?php }
@@ -2074,38 +2074,38 @@  discard block
 block discarded – undo
2074 2074
  */
2075 2075
 function geodir_action_add_listing_page_title()
2076 2076
 {
2077
-    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2078
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2079
-    /** This action is documented in geodirectory_template_actions.php */
2080
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2081
-    /** This action is documented in geodirectory_template_actions.php */
2082
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2083
-
2084
-    $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2085
-
2086
-    if(geodir_is_page('add-listing')){
2087
-        $gd_page = 'add-listing';
2088
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2089
-            $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2090
-        }elseif(isset($listing_type)){
2091
-            $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2092
-        }
2077
+	if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2078
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2079
+	/** This action is documented in geodirectory_template_actions.php */
2080
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2081
+	/** This action is documented in geodirectory_template_actions.php */
2082
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2083
+
2084
+	$title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2085
+
2086
+	if(geodir_is_page('add-listing')){
2087
+		$gd_page = 'add-listing';
2088
+		if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2089
+			$title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2090
+		}elseif(isset($listing_type)){
2091
+			$title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2092
+		}
2093 2093
 
2094
-    }
2094
+	}
2095 2095
 
2096 2096
 
2097
-    /**
2098
-     * Filter page title to replace variables.
2099
-     *
2100
-     * @since 1.5.4
2101
-     * @param string $title The page title including variables.
2102
-     * @param string $gd_page The GeoDirectory page type if any.
2103
-     */
2104
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2097
+	/**
2098
+	 * Filter page title to replace variables.
2099
+	 *
2100
+	 * @since 1.5.4
2101
+	 * @param string $title The page title including variables.
2102
+	 * @param string $gd_page The GeoDirectory page type if any.
2103
+	 */
2104
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2105 2105
 
2106
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2107
-    echo $title;
2108
-    echo '</h1></header>';
2106
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2107
+	echo $title;
2108
+	echo '</h1></header>';
2109 2109
 }
2110 2110
 
2111 2111
 add_action('geodir_add_listing_page_mandatory', 'geodir_action_add_listing_page_mandatory', 10);
@@ -2136,61 +2136,61 @@  discard block
 block discarded – undo
2136 2136
  */
2137 2137
 function geodir_action_add_listing_form()
2138 2138
 {
2139
-    global $cat_display, $post_cat, $current_user, $gd_session;
2140
-    $page_id = get_the_ID();
2141
-    $post = '';
2142
-    $title = '';
2143
-    $desc = '';
2144
-    $kw_tags = '';
2145
-    $required_msg = '';
2146
-    $submit_button = '';
2147
-
2148
-    $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2149
-
2150
-    $thumb_img_arr = array();
2151
-    $curImages = '';
2152
-
2153
-    if (isset($_REQUEST['backandedit'])) {
2154
-        global $post;
2155
-        $post = (object)$gd_session->get('listing');
2156
-        $listing_type = $post->listing_type;
2157
-        $title = $post->post_title;
2158
-        $desc = $post->post_desc;
2159
-        $post_cat = $post->post_category;
2160
-
2161
-        $kw_tags = $post->post_tags;
2162
-        $curImages = isset($post->post_images) ? $post->post_images : '';
2163
-    } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2164
-        global $post, $post_images;
2165
-
2166
-        $post = geodir_get_post_info($_REQUEST['pid']);
2167
-        $thumb_img_arr = geodir_get_images($post->ID);
2168
-        if ($thumb_img_arr) {
2169
-            foreach ($thumb_img_arr as $post_img) {
2170
-                $curImages .= $post_img->src . ',';
2171
-            }
2172
-        }
2139
+	global $cat_display, $post_cat, $current_user, $gd_session;
2140
+	$page_id = get_the_ID();
2141
+	$post = '';
2142
+	$title = '';
2143
+	$desc = '';
2144
+	$kw_tags = '';
2145
+	$required_msg = '';
2146
+	$submit_button = '';
2147
+
2148
+	$ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2149
+
2150
+	$thumb_img_arr = array();
2151
+	$curImages = '';
2152
+
2153
+	if (isset($_REQUEST['backandedit'])) {
2154
+		global $post;
2155
+		$post = (object)$gd_session->get('listing');
2156
+		$listing_type = $post->listing_type;
2157
+		$title = $post->post_title;
2158
+		$desc = $post->post_desc;
2159
+		$post_cat = $post->post_category;
2160
+
2161
+		$kw_tags = $post->post_tags;
2162
+		$curImages = isset($post->post_images) ? $post->post_images : '';
2163
+	} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2164
+		global $post, $post_images;
2165
+
2166
+		$post = geodir_get_post_info($_REQUEST['pid']);
2167
+		$thumb_img_arr = geodir_get_images($post->ID);
2168
+		if ($thumb_img_arr) {
2169
+			foreach ($thumb_img_arr as $post_img) {
2170
+				$curImages .= $post_img->src . ',';
2171
+			}
2172
+		}
2173 2173
 
2174
-        $listing_type = $post->post_type;
2175
-        $title = $post->post_title;
2176
-        $desc = $post->post_content;
2177
-        $kw_tags = $post->post_tags;
2178
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2179
-    } else {
2180
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2181
-    }
2174
+		$listing_type = $post->post_type;
2175
+		$title = $post->post_title;
2176
+		$desc = $post->post_content;
2177
+		$kw_tags = $post->post_tags;
2178
+		$kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2179
+	} else {
2180
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2181
+	}
2182 2182
 
2183
-    if ($current_user->ID != '0') {
2184
-        $user_login = true;
2185
-    }
2183
+	if ($current_user->ID != '0') {
2184
+		$user_login = true;
2185
+	}
2186 2186
 
2187
-    $post_type_info = geodir_get_posttype_info($listing_type);
2187
+	$post_type_info = geodir_get_posttype_info($listing_type);
2188 2188
 
2189
-    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? __($post_type_info['labels']['singular_name'], 'geodirectory') : __('Listing','geodirectory');
2189
+	$cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? __($post_type_info['labels']['singular_name'], 'geodirectory') : __('Listing','geodirectory');
2190 2190
     
2191
-    $package_info = array();
2192
-    $package_info = geodir_post_package_info($package_info, $post);
2193
-    ?>
2191
+	$package_info = array();
2192
+	$package_info = geodir_post_package_info($package_info, $post);
2193
+	?>
2194 2194
     <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2195 2195
         <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2196 2196
         <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
@@ -2201,114 +2201,114 @@  discard block
 block discarded – undo
2201 2201
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2202 2202
             <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2203 2203
         <?php
2204
-        } 
2205
-        /**
2206
-         * Called at the very top of the add listing page form for frontend.
2207
-         *
2208
-         * This is called just before the "Enter Listing Details" text.
2209
-         *
2210
-         * @since 1.0.0
2211
-         */
2212
-        do_action('geodir_before_detail_fields');
2213
-        ?>
2204
+		} 
2205
+		/**
2206
+		 * Called at the very top of the add listing page form for frontend.
2207
+		 *
2208
+		 * This is called just before the "Enter Listing Details" text.
2209
+		 *
2210
+		 * @since 1.0.0
2211
+		 */
2212
+		do_action('geodir_before_detail_fields');
2213
+		?>
2214 2214
         <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2215 2215
         <?php
2216
-        /**
2217
-         * Called at the top of the add listing page form for frontend.
2218
-         *
2219
-         * This is called after the "Enter Listing Details" text.
2220
-         *
2221
-         * @since 1.0.0
2222
-         */
2223
-        do_action('geodir_before_main_form_fields');
2224
-        ?>
2216
+		/**
2217
+		 * Called at the top of the add listing page form for frontend.
2218
+		 *
2219
+		 * This is called after the "Enter Listing Details" text.
2220
+		 *
2221
+		 * @since 1.0.0
2222
+		 */
2223
+		do_action('geodir_before_main_form_fields');
2224
+		?>
2225 2225
         <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details">
2226 2226
             <label><?php
2227
-                /**
2228
-                 * Filter the add listing page title input label.
2229
-                 *
2230
-                 * @since 1.6.11
2231
-                 * @param string $title The title to be output.
2232
-                 * @param string $cpt_singular_name The singular title of the curent CPT.
2233
-                 * @param string $listing_type The CPT being requested. ie: gd_place.
2234
-                 */
2235
-                echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label>
2227
+				/**
2228
+				 * Filter the add listing page title input label.
2229
+				 *
2230
+				 * @since 1.6.11
2231
+				 * @param string $title The title to be output.
2232
+				 * @param string $cpt_singular_name The singular title of the curent CPT.
2233
+				 * @param string $listing_type The CPT being requested. ie: gd_place.
2234
+				 */
2235
+				echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label>
2236 2236
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
2237 2237
                    value="<?php echo esc_attr(stripslashes($title)); ?>"/>
2238 2238
             <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2239 2239
         </div>
2240 2240
         <?php
2241
-        $show_editor = get_option('geodir_tiny_editor_on_add_listing');
2242
-        $show_editor = !empty($show_editor) && in_array($listing_type, $show_editor) ? true : false;
2243
-        /**
2244
-         * Filter whether to show or don't show the editor.
2245
-         *
2246
-         * @since 1.6.16
2247
-         * @param bool $show_editor If true the editor will be available for description field.
2248
-         * @param object $package_info The listing package.
2249
-         * @param string $listing_type The current post type.
2250
-         * @param object $post The current post object.
2251
-         */
2252
-        $show_editor = apply_filters('geodir_description_field_show_editor', $show_editor, $package_info, $listing_type, $post);
2253
-
2254
-        $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2255
-        $desc_limit = '';
2256
-        /**
2257
-         * Filter the add listing description field character limit number.
2258
-         *
2259
-         * @since 1.0.0
2260
-         * @param int $desc_limit The amount of characters to limit the description to.
2261
-         */
2262
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2263
-        /**
2264
-         * Filter the add listing description field text.
2265
-         *
2266
-         * @since 1.0.0
2267
-         * @param string $desc The text for the description field.
2268
-         * @param int $desc_limit The character limit number if any.
2269
-         */
2270
-        $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2271
-        $desc_limit_msg = '';
2272
-        /**
2273
-         * Filter the add listing description limit message.
2274
-         *
2275
-         * This is the message shown if there is a limit applied to the amount of characters the description can use.
2276
-         *
2277
-         * @since 1.0.0
2278
-         * @param string $desc_limit_msg The limit message string if any.
2279
-         * @param int $desc_limit The character limit numer if any.
2280
-         */
2281
-        $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2241
+		$show_editor = get_option('geodir_tiny_editor_on_add_listing');
2242
+		$show_editor = !empty($show_editor) && in_array($listing_type, $show_editor) ? true : false;
2243
+		/**
2244
+		 * Filter whether to show or don't show the editor.
2245
+		 *
2246
+		 * @since 1.6.16
2247
+		 * @param bool $show_editor If true the editor will be available for description field.
2248
+		 * @param object $package_info The listing package.
2249
+		 * @param string $listing_type The current post type.
2250
+		 * @param object $post The current post object.
2251
+		 */
2252
+		$show_editor = apply_filters('geodir_description_field_show_editor', $show_editor, $package_info, $listing_type, $post);
2253
+
2254
+		$desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2255
+		$desc_limit = '';
2256
+		/**
2257
+		 * Filter the add listing description field character limit number.
2258
+		 *
2259
+		 * @since 1.0.0
2260
+		 * @param int $desc_limit The amount of characters to limit the description to.
2261
+		 */
2262
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2263
+		/**
2264
+		 * Filter the add listing description field text.
2265
+		 *
2266
+		 * @since 1.0.0
2267
+		 * @param string $desc The text for the description field.
2268
+		 * @param int $desc_limit The character limit number if any.
2269
+		 */
2270
+		$desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2271
+		$desc_limit_msg = '';
2272
+		/**
2273
+		 * Filter the add listing description limit message.
2274
+		 *
2275
+		 * This is the message shown if there is a limit applied to the amount of characters the description can use.
2276
+		 *
2277
+		 * @since 1.0.0
2278
+		 * @param string $desc_limit_msg The limit message string if any.
2279
+		 * @param int $desc_limit The character limit numer if any.
2280
+		 */
2281
+		$desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2282 2282
         
2283
-        $desc_class = '';
2284
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2285
-            /**
2286
-             * Called on the add listing page form for frontend just before the description field.
2287
-             *
2288
-             * @since 1.0.0
2289
-             */
2290
-            do_action('geodir_before_description_field');
2283
+		$desc_class = '';
2284
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2285
+			/**
2286
+			 * Called on the add listing page form for frontend just before the description field.
2287
+			 *
2288
+			 * @since 1.0.0
2289
+			 */
2290
+			do_action('geodir_before_description_field');
2291 2291
             
2292
-            $desc_class = ' required_field';
2293
-        } else {
2294
-            $desc_class = ' hidden';
2295
-        }
2296
-        ?>
2292
+			$desc_class = ' required_field';
2293
+		} else {
2294
+			$desc_class = ' hidden';
2295
+		}
2296
+		?>
2297 2297
         <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2298 2298
             <label><?php
2299
-                /**
2300
-                 * Filter the add listing page description input label.
2301
-                 *
2302
-                 * @since 1.6.11
2303
-                 * @param string $title The title to be output.
2304
-                 * @param string $cpt_singular_name The singular title of the curent CPT.
2305
-                 * @param string $listing_type The CPT being requested. ie: gd_place.
2306
-                 */
2307
-                echo apply_filters('geodir_add_listing_description_label',sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2299
+				/**
2300
+				 * Filter the add listing page description input label.
2301
+				 *
2302
+				 * @since 1.6.11
2303
+				 * @param string $title The title to be output.
2304
+				 * @param string $cpt_singular_name The singular title of the curent CPT.
2305
+				 * @param string $listing_type The CPT being requested. ie: gd_place.
2306
+				 */
2307
+				echo apply_filters('geodir_add_listing_description_label',sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2308 2308
             <?php
2309
-            if ($show_editor) {
2310
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2311
-            ?>
2309
+			if ($show_editor) {
2310
+				$editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2311
+			?>
2312 2312
                 <div class="editor" field_id="post_desc" field_type="editor">
2313 2313
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2314 2314
                 </div>
@@ -2322,56 +2322,56 @@  discard block
 block discarded – undo
2322 2322
             <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2323 2323
         </div>
2324 2324
         <?php
2325
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2326
-            /**
2327
-             * Called on the add listing page form for frontend just after the description field.
2328
-             *
2329
-             * @since 1.0.0
2330
-             */
2331
-            do_action('geodir_after_description_field');
2332
-        }
2325
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2326
+			/**
2327
+			 * Called on the add listing page form for frontend just after the description field.
2328
+			 *
2329
+			 * @since 1.0.0
2330
+			 */
2331
+			do_action('geodir_after_description_field');
2332
+		}
2333 2333
         
2334
-        $kw_tags = esc_attr(stripslashes($kw_tags));
2335
-        $kw_tags_count = TAGKW_TEXT_COUNT;
2336
-        $kw_tags_msg = TAGKW_MSG;
2337
-        /**
2338
-         * Filter the add listing tags character limit.
2339
-         *
2340
-         * @since 1.0.0
2341
-         * @param int $kw_tags_count The character count limit if any.
2342
-         */
2343
-        $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2344
-        /**
2345
-         * Filter the add listing tags field value.
2346
-         *
2347
-         * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2348
-         *
2349
-         * @since 1.0.0
2350
-         * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2351
-         * @param int $kw_tags_count The character count limit if any.
2352
-         */
2353
-        $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2354
-        /**
2355
-         * Filter the add listing tags field message text.
2356
-         *
2357
-         * @since 1.0.0
2358
-         * @param string $kw_tags_msg The message shown under the field.
2359
-         * @param int $kw_tags_count The character count limit if any.
2360
-         */
2361
-        $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2334
+		$kw_tags = esc_attr(stripslashes($kw_tags));
2335
+		$kw_tags_count = TAGKW_TEXT_COUNT;
2336
+		$kw_tags_msg = TAGKW_MSG;
2337
+		/**
2338
+		 * Filter the add listing tags character limit.
2339
+		 *
2340
+		 * @since 1.0.0
2341
+		 * @param int $kw_tags_count The character count limit if any.
2342
+		 */
2343
+		$kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2344
+		/**
2345
+		 * Filter the add listing tags field value.
2346
+		 *
2347
+		 * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2348
+		 *
2349
+		 * @since 1.0.0
2350
+		 * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2351
+		 * @param int $kw_tags_count The character count limit if any.
2352
+		 */
2353
+		$kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2354
+		/**
2355
+		 * Filter the add listing tags field message text.
2356
+		 *
2357
+		 * @since 1.0.0
2358
+		 * @param string $kw_tags_msg The message shown under the field.
2359
+		 * @param int $kw_tags_count The character count limit if any.
2360
+		 */
2361
+		$kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2362 2362
         
2363
-        $tags_class = '';
2364
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2365
-            /**
2366
-             * Called on the add listing page form for frontend just before the tags field.
2367
-             *
2368
-             * @since 1.0.0
2369
-             */
2370
-            do_action('geodir_before_listing_tags_field');
2371
-        } else {
2372
-            $tags_class = ' hidden';
2373
-        }
2374
-        ?>
2363
+		$tags_class = '';
2364
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2365
+			/**
2366
+			 * Called on the add listing page form for frontend just before the tags field.
2367
+			 *
2368
+			 * @since 1.0.0
2369
+			 */
2370
+			do_action('geodir_before_listing_tags_field');
2371
+		} else {
2372
+			$tags_class = ' hidden';
2373
+		}
2374
+		?>
2375 2375
         <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2376 2376
             <label><?php echo TAGKW_TEXT; ?></label>
2377 2377
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
@@ -2379,90 +2379,90 @@  discard block
 block discarded – undo
2379 2379
             <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2380 2380
         </div>
2381 2381
         <?php
2382
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2383
-            /**
2384
-             * Called on the add listing page form for frontend just after the tags field.
2385
-             *
2386
-             * @since 1.0.0
2387
-             */
2388
-            do_action('geodir_after_listing_tags_field');
2389
-        }
2382
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2383
+			/**
2384
+			 * Called on the add listing page form for frontend just after the tags field.
2385
+			 *
2386
+			 * @since 1.0.0
2387
+			 */
2388
+			do_action('geodir_after_listing_tags_field');
2389
+		}
2390 2390
         
2391
-        $package_info = array();
2392
-        $package_info = geodir_post_package_info($package_info, $post);
2391
+		$package_info = array();
2392
+		$package_info = geodir_post_package_info($package_info, $post);
2393 2393
         
2394
-        geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2394
+		geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2395 2395
         
2396
-        // adjust values here
2397
-        $id = "post_images"; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls
2398
-
2399
-        $multiple = true; // allow multiple files upload
2396
+		// adjust values here
2397
+		$id = "post_images"; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls
2400 2398
 
2401
-        $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2399
+		$multiple = true; // allow multiple files upload
2402 2400
 
2403
-        $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2401
+		$width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2404 2402
 
2405
-        $thumb_img_arr = array();
2406
-        $totImg = 0;
2407
-        if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2408
-            $post = (object)$gd_session->get('listing');
2409
-            if (isset($post->post_images))
2410
-                $curImages = trim($post->post_images, ",");
2403
+		$height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2411 2404
 
2405
+		$thumb_img_arr = array();
2406
+		$totImg = 0;
2407
+		if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2408
+			$post = (object)$gd_session->get('listing');
2409
+			if (isset($post->post_images))
2410
+				$curImages = trim($post->post_images, ",");
2412 2411
 
2413
-            if ($curImages != '') {
2414
-                $curImages_array = explode(',', $curImages);
2415
-                $totImg = count($curImages_array);
2416
-            }
2417 2412
 
2418
-            $listing_type = $post->listing_type;
2413
+			if ($curImages != '') {
2414
+				$curImages_array = explode(',', $curImages);
2415
+				$totImg = count($curImages_array);
2416
+			}
2419 2417
 
2420
-        } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2421
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2422
-            $listing_type = $post->post_type;
2423
-            $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2418
+			$listing_type = $post->listing_type;
2424 2419
 
2425
-        } else {
2426
-            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2427
-        }
2420
+		} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2421
+			$post = geodir_get_post_info((int)$_REQUEST['pid']);
2422
+			$listing_type = $post->post_type;
2423
+			$thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2428 2424
 
2425
+		} else {
2426
+			$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2427
+		}
2429 2428
 
2430
-        if (!empty($thumb_img_arr)) {
2431
-            foreach ($thumb_img_arr as $img) {
2432
-                //$curImages = $img->src.",";
2433
-            }
2434 2429
 
2435
-            $totImg = count((array)$thumb_img_arr);
2436
-        }
2430
+		if (!empty($thumb_img_arr)) {
2431
+			foreach ($thumb_img_arr as $img) {
2432
+				//$curImages = $img->src.",";
2433
+			}
2437 2434
 
2438
-        if ($curImages != '')
2439
-            $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2440
-        else
2441
-            $svalue = '';
2442
-
2443
-        $image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0';
2444
-        $show_image_input_box = ($image_limit != '0');
2445
-        /**
2446
-         * Filter to be able to show/hide the image upload section of the add listing form.
2447
-         *
2448
-         * @since 1.0.0
2449
-         * @param bool $show_image_input_box Set true to show. Set false to not show.
2450
-         * @param string $listing_type The custom post type slug.
2451
-         */
2452
-        $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2453
-        if ($show_image_input_box) {
2454
-            ?>
2435
+			$totImg = count((array)$thumb_img_arr);
2436
+		}
2437
+
2438
+		if ($curImages != '')
2439
+			$svalue = $curImages; // this will be initial value of the above form field. Image urls.
2440
+		else
2441
+			$svalue = '';
2442
+
2443
+		$image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0';
2444
+		$show_image_input_box = ($image_limit != '0');
2445
+		/**
2446
+		 * Filter to be able to show/hide the image upload section of the add listing form.
2447
+		 *
2448
+		 * @since 1.0.0
2449
+		 * @param bool $show_image_input_box Set true to show. Set false to not show.
2450
+		 * @param string $listing_type The custom post type slug.
2451
+		 */
2452
+		$show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2453
+		if ($show_image_input_box) {
2454
+			?>
2455 2455
 
2456 2456
             <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2457 2457
                 <?php if ($image_limit == 1) {
2458
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2459
-                } ?>
2458
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2459
+				} ?>
2460 2460
                 <?php if ($image_limit > 1) {
2461
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2462
-                } ?>
2461
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2462
+				} ?>
2463 2463
                 <?php if ($image_limit == '') {
2464
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2465
-                } ?>
2464
+					echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2465
+				} ?>
2466 2466
             </h5>
2467 2467
 
2468 2468
             <div class="geodir_form_row clearfix" id="<?php echo $id; ?>dropbox"
@@ -2500,12 +2500,12 @@  discard block
 block discarded – undo
2500 2500
         <?php } ?>
2501 2501
 
2502 2502
         <?php
2503
-        /**
2504
-         * Called on the add listing page form for frontend just after the image upload field.
2505
-         *
2506
-         * @since 1.0.0
2507
-         */
2508
-        do_action('geodir_after_main_form_fields');?>
2503
+		/**
2504
+		 * Called on the add listing page form for frontend just after the image upload field.
2505
+		 *
2506
+		 * @since 1.0.0
2507
+		 */
2508
+		do_action('geodir_after_main_form_fields');?>
2509 2509
 
2510 2510
 
2511 2511
         <!-- add captcha code -->
@@ -2534,7 +2534,7 @@  discard block
 block discarded – undo
2534 2534
 
2535 2535
     </form>
2536 2536
     <?php
2537
-    wp_reset_query();
2537
+	wp_reset_query();
2538 2538
 }
2539 2539
 
2540 2540
 /**
@@ -2545,7 +2545,7 @@  discard block
 block discarded – undo
2545 2545
  */
2546 2546
 function geodir_add_listing_sidebar_widget_area()
2547 2547
 {
2548
-    dynamic_sidebar('geodir_add_listing_sidebar');
2548
+	dynamic_sidebar('geodir_add_listing_sidebar');
2549 2549
 }
2550 2550
 
2551 2551
 add_action('geodir_add_listing_sidebar_inside', 'geodir_add_listing_sidebar_widget_area', 10);
@@ -2560,16 +2560,16 @@  discard block
 block discarded – undo
2560 2560
  */
2561 2561
 function geodir_action_add_listing_sidebar()
2562 2562
 {
2563
-    /** This action is documented in geodirectory_template_actions.php */
2564
-    do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2565
-    /**
2566
-     * This is used to add the content to the add listing page sidebar.
2567
-     *
2568
-     * @since 1.0.0
2569
-     */
2570
-    do_action('geodir_add_listing_sidebar_inside');
2571
-    /** This action is documented in geodirectory_template_actions.php */
2572
-    do_action('geodir_sidebar_right_close', 'details-page');
2563
+	/** This action is documented in geodirectory_template_actions.php */
2564
+	do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2565
+	/**
2566
+	 * This is used to add the content to the add listing page sidebar.
2567
+	 *
2568
+	 * @since 1.0.0
2569
+	 */
2570
+	do_action('geodir_add_listing_sidebar_inside');
2571
+	/** This action is documented in geodirectory_template_actions.php */
2572
+	do_action('geodir_sidebar_right_close', 'details-page');
2573 2573
 }
2574 2574
 
2575 2575
 ###############################################
@@ -2586,11 +2586,11 @@  discard block
 block discarded – undo
2586 2586
  */
2587 2587
 function geodir_action_geodir_sidebar_signup_top()
2588 2588
 {
2589
-    ?>
2589
+	?>
2590 2590
     <div
2591 2591
         class="<?php
2592
-        /** This action is documented in geodirectory_template_actions.php */
2593
-        echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2592
+		/** This action is documented in geodirectory_template_actions.php */
2593
+		echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2594 2594
         <?php dynamic_sidebar('Reg/Login Top Section');?>
2595 2595
     </div><!-- clearfix ends here-->
2596 2596
 <?php
@@ -2609,9 +2609,9 @@  discard block
 block discarded – undo
2609 2609
 function geodir_action_signup_forms()
2610 2610
 {
2611 2611
 
2612
-    global $user_login;
2612
+	global $user_login;
2613 2613
 
2614
-    ?>
2614
+	?>
2615 2615
     <script type="text/javascript">
2616 2616
         <?php if ( $user_login ) { ?>
2617 2617
         setTimeout(function () {
@@ -2647,65 +2647,65 @@  discard block
 block discarded – undo
2647 2647
         <?php } ?>
2648 2648
     </script><?php
2649 2649
 
2650
-    global $errors;
2651
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2652
-        $errors->add('claim_login', LOGIN_CLAIM);
2653
-
2654
-    if (!empty($errors)) {
2655
-        foreach ($errors as $errorsObj) {
2656
-            foreach ($errorsObj as $key => $val) {
2657
-                for ($i = 0; $i < count($val); $i++) {
2658
-                    echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2659
-                    $registration_error_msg = 1;
2660
-                }
2661
-            }
2662
-        }
2663
-    }
2650
+	global $errors;
2651
+	if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2652
+		$errors->add('claim_login', LOGIN_CLAIM);
2653
+
2654
+	if (!empty($errors)) {
2655
+		foreach ($errors as $errorsObj) {
2656
+			foreach ($errorsObj as $key => $val) {
2657
+				for ($i = 0; $i < count($val); $i++) {
2658
+					echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2659
+					$registration_error_msg = 1;
2660
+				}
2661
+			}
2662
+		}
2663
+	}
2664 2664
 
2665
-    if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2666
-        ?>
2665
+	if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2666
+		?>
2667 2667
 
2668 2668
         <div class="login_form">
2669 2669
             <?php
2670
-            /**
2671
-             * Contains login form template.
2672
-             *
2673
-             * @since 1.0.0
2674
-             */
2675
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2670
+			/**
2671
+			 * Contains login form template.
2672
+			 *
2673
+			 * @since 1.0.0
2674
+			 */
2675
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2676 2676
         </div>
2677 2677
 
2678 2678
     <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
2679 2679
 
2680 2680
         <div class="registration_form">
2681 2681
             <?php
2682
-            /**
2683
-             * Contains registration form template.
2684
-             *
2685
-             * @since 1.0.0
2686
-             */
2687
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2682
+			/**
2683
+			 * Contains registration form template.
2684
+			 *
2685
+			 * @since 1.0.0
2686
+			 */
2687
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2688 2688
         </div>
2689 2689
 
2690 2690
     <?php } else { ?>
2691 2691
 
2692 2692
         <div class="login_form_l">
2693 2693
             <?php
2694
-            /**
2695
-             * Contains login form template.
2696
-             *
2697
-             * @since 1.0.0
2698
-             */
2699
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2694
+			/**
2695
+			 * Contains login form template.
2696
+			 *
2697
+			 * @since 1.0.0
2698
+			 */
2699
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2700 2700
         </div>
2701 2701
         <div class="registration_form_r">
2702 2702
             <?php
2703
-            /**
2704
-             * Contains registration form template.
2705
-             *
2706
-             * @since 1.0.0
2707
-             */
2708
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2703
+			/**
2704
+			 * Contains registration form template.
2705
+			 *
2706
+			 * @since 1.0.0
2707
+			 */
2708
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2709 2709
         </div>
2710 2710
 
2711 2711
     <?php }?>
@@ -2736,66 +2736,66 @@  discard block
 block discarded – undo
2736 2736
  */
2737 2737
 function geodir_action_author_page_title()
2738 2738
 {
2739
-    global $term;
2739
+	global $term;
2740 2740
 
2741
-    $gd_post_type = geodir_get_current_posttype();
2742
-    $post_type_info = get_post_type_object($gd_post_type);
2741
+	$gd_post_type = geodir_get_current_posttype();
2742
+	$post_type_info = get_post_type_object($gd_post_type);
2743 2743
 
2744
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2745
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2746
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2747
-    }
2744
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
2745
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2746
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2747
+	}
2748 2748
 
2749
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2750
-    $single_name = $post_type_info->labels->singular_name;
2749
+	$list_title = $add_string_in_title . $post_type_info->labels->name;
2750
+	$single_name = $post_type_info->labels->singular_name;
2751 2751
 
2752
-    $taxonomy = geodir_get_taxonomies($gd_post_type);
2752
+	$taxonomy = geodir_get_taxonomies($gd_post_type);
2753 2753
 
2754
-    if (!empty($term)) {
2755
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
2756
-        if (!empty($current_term))
2757
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2758
-    }
2754
+	if (!empty($term)) {
2755
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
2756
+		if (!empty($current_term))
2757
+			$list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2758
+	}
2759 2759
 
2760 2760
 
2761
-    if (is_search()) {
2762
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2761
+	if (is_search()) {
2762
+		$list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2763 2763
 
2764
-    }
2765
-    /** This action is documented in geodirectory_template_actions.php */
2766
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2767
-    /** This action is documented in geodirectory_template_actions.php */
2768
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2764
+	}
2765
+	/** This action is documented in geodirectory_template_actions.php */
2766
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2767
+	/** This action is documented in geodirectory_template_actions.php */
2768
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2769 2769
 
2770
-    $title = $list_title;
2771
-    if(geodir_is_page('author')){
2772
-        $gd_page = 'author';
2773
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2774
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2775
-        }else{
2776
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2777
-        }
2770
+	$title = $list_title;
2771
+	if(geodir_is_page('author')){
2772
+		$gd_page = 'author';
2773
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2774
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2775
+		}else{
2776
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2777
+		}
2778 2778
 
2779
-    }
2779
+	}
2780 2780
 
2781 2781
 
2782
-    /**
2783
-     * Filter page title to replace variables.
2784
-     *
2785
-     * @since 1.5.4
2786
-     * @param string $title The page title including variables.
2787
-     * @param string $gd_page The GeoDirectory page type if any.
2788
-     */
2789
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2782
+	/**
2783
+	 * Filter page title to replace variables.
2784
+	 *
2785
+	 * @since 1.5.4
2786
+	 * @param string $title The page title including variables.
2787
+	 * @param string $gd_page The GeoDirectory page type if any.
2788
+	 */
2789
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2790 2790
 
2791
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2792
-        /**
2793
-         * Filter the author page title text.
2794
-         *
2795
-         * @since 1.0.0
2796
-         * @param string $list_title The title for the page.
2797
-         */
2798
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2791
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2792
+		/**
2793
+		 * Filter the author page title text.
2794
+		 *
2795
+		 * @since 1.0.0
2796
+		 * @param string $list_title The title for the page.
2797
+		 */
2798
+		apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2799 2799
 }
2800 2800
 
2801 2801
 
@@ -2813,11 +2813,11 @@  discard block
 block discarded – undo
2813 2813
  */
2814 2814
 function geodir_action_geodir_sidebar_author_top()
2815 2815
 {
2816
-    if (get_option('geodir_show_author_top_section')) { ?>
2816
+	if (get_option('geodir_show_author_top_section')) { ?>
2817 2817
         <div
2818 2818
             class="<?php
2819
-            /** This action is documented in geodirectory_template_actions.php */
2820
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2819
+			/** This action is documented in geodirectory_template_actions.php */
2820
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2821 2821
             <?php dynamic_sidebar('geodir_author_top'); ?>
2822 2822
         </div><!-- clearfix ends here-->
2823 2823
     <?php }
@@ -2833,7 +2833,7 @@  discard block
 block discarded – undo
2833 2833
  */
2834 2834
 function geodir_author_left_section()
2835 2835
 {
2836
-    if (get_option('geodir_show_author_left_section')) { ?>
2836
+	if (get_option('geodir_show_author_left_section')) { ?>
2837 2837
         <div class="geodir-content-left geodir-sidebar-wrap">
2838 2838
             <?php dynamic_sidebar('geodir_author_left_sidebar'); ?>
2839 2839
         </div><!-- end geodir-content-left -->
@@ -2854,19 +2854,19 @@  discard block
 block discarded – undo
2854 2854
  */
2855 2855
 function geodir_action_author_sidebar_left()
2856 2856
 {
2857
-    if (get_option('geodir_show_author_left_section')) {
2857
+	if (get_option('geodir_show_author_left_section')) {
2858 2858
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
2859
-        /** This action is documented in geodirectory_template_actions.php */
2860
-        do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2861
-        /**
2862
-         * This is used to add the content to the author page left sidebar (if active).
2863
-         *
2864
-         * @since 1.0.0
2865
-         */
2866
-        do_action('geodir_author_sidebar_left_inside');
2867
-        /** This action is documented in geodirectory_template_actions.php */
2868
-        do_action('geodir_sidebar_left_close', 'author-page');
2869
-    }
2859
+		/** This action is documented in geodirectory_template_actions.php */
2860
+		do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2861
+		/**
2862
+		 * This is used to add the content to the author page left sidebar (if active).
2863
+		 *
2864
+		 * @since 1.0.0
2865
+		 */
2866
+		do_action('geodir_author_sidebar_left_inside');
2867
+		/** This action is documented in geodirectory_template_actions.php */
2868
+		do_action('geodir_sidebar_left_close', 'author-page');
2869
+	}
2870 2870
 }
2871 2871
 
2872 2872
 /**
@@ -2879,7 +2879,7 @@  discard block
 block discarded – undo
2879 2879
  */
2880 2880
 function geodir_author_right_section()
2881 2881
 {
2882
-    if (get_option('geodir_show_author_right_section')) { ?>
2882
+	if (get_option('geodir_show_author_right_section')) { ?>
2883 2883
         <div class="geodir-content-right geodir-sidebar-wrap">
2884 2884
             <?php dynamic_sidebar('geodir_author_right_sidebar'); ?>
2885 2885
         </div><!-- end geodir-content-right -->
@@ -2899,18 +2899,18 @@  discard block
 block discarded – undo
2899 2899
  */
2900 2900
 function geodir_action_author_sidebar_right()
2901 2901
 {
2902
-    if (get_option('geodir_show_author_right_section')) {
2903
-        /** This action is documented in geodirectory_template_actions.php */
2904
-        do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2905
-        /**
2906
-         * This is used to add the content to the author page right sidebar (if active).
2907
-         *
2908
-         * @since 1.0.0
2909
-         */
2910
-        do_action('geodir_author_sidebar_right_inside');
2911
-        /** This action is documented in geodirectory_template_actions.php */
2912
-        do_action('geodir_sidebar_right_close', 'author-page');
2913
-    }
2902
+	if (get_option('geodir_show_author_right_section')) {
2903
+		/** This action is documented in geodirectory_template_actions.php */
2904
+		do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2905
+		/**
2906
+		 * This is used to add the content to the author page right sidebar (if active).
2907
+		 *
2908
+		 * @since 1.0.0
2909
+		 */
2910
+		do_action('geodir_author_sidebar_right_inside');
2911
+		/** This action is documented in geodirectory_template_actions.php */
2912
+		do_action('geodir_sidebar_right_close', 'author-page');
2913
+	}
2914 2914
 }
2915 2915
 
2916 2916
 /**
@@ -2922,14 +2922,14 @@  discard block
 block discarded – undo
2922 2922
  */
2923 2923
 function geodir_action_author_content_inside()
2924 2924
 {
2925
-    global $gridview_columns;
2926
-    $listing_view = get_option('geodir_author_view');
2927
-    if (strstr($listing_view, 'gridview')) {
2928
-        $gridview_columns = $listing_view;
2929
-        $listing_view_exp = explode('_', $listing_view);
2930
-        $listing_view = $listing_view_exp[0];
2931
-    }
2932
-    geodir_get_template_part('listing', 'listview');
2925
+	global $gridview_columns;
2926
+	$listing_view = get_option('geodir_author_view');
2927
+	if (strstr($listing_view, 'gridview')) {
2928
+		$gridview_columns = $listing_view;
2929
+		$listing_view_exp = explode('_', $listing_view);
2930
+		$listing_view = $listing_view_exp[0];
2931
+	}
2932
+	geodir_get_template_part('listing', 'listview');
2933 2933
 }
2934 2934
 
2935 2935
 add_action('geodir_author_content_inside', 'geodir_action_author_content_inside', 10);
@@ -2944,22 +2944,22 @@  discard block
 block discarded – undo
2944 2944
  */
2945 2945
 function geodir_action_author_content()
2946 2946
 {
2947
-    /** This action is documented in geodirectory_template_actions.php */
2948
-    do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2949
-    echo '<div class="clearfix">';
2950
-    /** This action is documented in geodirectory_template_actions.php */
2951
-    do_action('geodir_before_listing');
2952
-    echo '</div>';
2953
-    /**
2954
-     * This is used to add the content to the author page main content.
2955
-     *
2956
-     * @since 1.0.0
2957
-     */
2958
-    do_action('geodir_author_content_inside');
2959
-    /** This action is documented in geodirectory_template_actions.php */
2960
-    do_action('geodir_after_listing');
2961
-    /** This action is documented in geodirectory_template_actions.php */
2962
-    do_action('geodir_main_content_close', 'author-page');
2947
+	/** This action is documented in geodirectory_template_actions.php */
2948
+	do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2949
+	echo '<div class="clearfix">';
2950
+	/** This action is documented in geodirectory_template_actions.php */
2951
+	do_action('geodir_before_listing');
2952
+	echo '</div>';
2953
+	/**
2954
+	 * This is used to add the content to the author page main content.
2955
+	 *
2956
+	 * @since 1.0.0
2957
+	 */
2958
+	do_action('geodir_author_content_inside');
2959
+	/** This action is documented in geodirectory_template_actions.php */
2960
+	do_action('geodir_after_listing');
2961
+	/** This action is documented in geodirectory_template_actions.php */
2962
+	do_action('geodir_main_content_close', 'author-page');
2963 2963
 }
2964 2964
 
2965 2965
 add_action('geodir_sidebar_author_bottom_section', 'geodir_action_sidebar_author_bottom_section', 10);
@@ -2973,11 +2973,11 @@  discard block
 block discarded – undo
2973 2973
  */
2974 2974
 function geodir_action_sidebar_author_bottom_section()
2975 2975
 {
2976
-    if (get_option('geodir_show_author_bottom_section')) { ?>
2976
+	if (get_option('geodir_show_author_bottom_section')) { ?>
2977 2977
         <div
2978 2978
             class="<?php
2979
-            /** This action is documented in geodirectory_template_actions.php */
2980
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2979
+			/** This action is documented in geodirectory_template_actions.php */
2980
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2981 2981
             <?php dynamic_sidebar('geodir_author_bottom'); ?>
2982 2982
         </div><!-- clearfix ends here-->
2983 2983
     <?php }
@@ -2996,23 +2996,23 @@  discard block
 block discarded – undo
2996 2996
  */
2997 2997
 function geodir_action_search_page_title()
2998 2998
 {
2999
-    $gd_post_type = geodir_get_current_posttype();
3000
-    $post_type_info = get_post_type_object($gd_post_type);
2999
+	$gd_post_type = geodir_get_current_posttype();
3000
+	$post_type_info = get_post_type_object($gd_post_type);
3001 3001
 
3002
-    $pt_name = '';
3003
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
3002
+	$pt_name = '';
3003
+	if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
3004 3004
 
3005
-    if (is_search()) {
3006
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
3005
+	if (is_search()) {
3006
+		$list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
3007 3007
 
3008
-    }
3009
-    /** This action is documented in geodirectory_template_actions.php */
3010
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
3011
-    /** This action is documented in geodirectory_template_actions.php */
3012
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
3013
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
3014
-        /** This action is documented in geodirectory_template_actions.php */
3015
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
3008
+	}
3009
+	/** This action is documented in geodirectory_template_actions.php */
3010
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
3011
+	/** This action is documented in geodirectory_template_actions.php */
3012
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
3013
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
3014
+		/** This action is documented in geodirectory_template_actions.php */
3015
+		apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
3016 3016
 }
3017 3017
 
3018 3018
 // action for adding the listings page top widget area
@@ -3028,11 +3028,11 @@  discard block
 block discarded – undo
3028 3028
  */
3029 3029
 function geodir_action_geodir_sidebar_search_top()
3030 3030
 {
3031
-    if (get_option('geodir_show_search_top_section')) { ?>
3031
+	if (get_option('geodir_show_search_top_section')) { ?>
3032 3032
         <div
3033 3033
             class="<?php
3034
-            /** This action is documented in geodirectory_template_actions.php */
3035
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
3034
+			/** This action is documented in geodirectory_template_actions.php */
3035
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
3036 3036
             <?php dynamic_sidebar('geodir_search_top'); ?>
3037 3037
         </div><!-- clearfix ends here-->
3038 3038
     <?php }
@@ -3048,7 +3048,7 @@  discard block
 block discarded – undo
3048 3048
  */
3049 3049
 function geodir_search_left_section()
3050 3050
 {
3051
-    if (get_option('geodir_show_search_left_section')) { ?>
3051
+	if (get_option('geodir_show_search_left_section')) { ?>
3052 3052
         <div class="geodir-content-left geodir-sidebar-wrap">
3053 3053
             <?php dynamic_sidebar('geodir_search_left_sidebar'); ?>
3054 3054
         </div><!-- end geodir-content-left -->
@@ -3068,19 +3068,19 @@  discard block
 block discarded – undo
3068 3068
  */
3069 3069
 function geodir_action_search_sidebar_left()
3070 3070
 {
3071
-    if (get_option('geodir_show_search_left_section')) {
3071
+	if (get_option('geodir_show_search_left_section')) {
3072 3072
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3073
-        /** This action is documented in geodirectory_template_actions.php */
3074
-        do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3075
-        /**
3076
-         * This is used to add the content to the search page left sidebar (if active).
3077
-         *
3078
-         * @since 1.0.0
3079
-         */
3080
-        do_action('geodir_search_sidebar_left_inside');
3081
-        /** This action is documented in geodirectory_template_actions.php */
3082
-        do_action('geodir_sidebar_left_close', 'search-page');
3083
-    }
3073
+		/** This action is documented in geodirectory_template_actions.php */
3074
+		do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3075
+		/**
3076
+		 * This is used to add the content to the search page left sidebar (if active).
3077
+		 *
3078
+		 * @since 1.0.0
3079
+		 */
3080
+		do_action('geodir_search_sidebar_left_inside');
3081
+		/** This action is documented in geodirectory_template_actions.php */
3082
+		do_action('geodir_sidebar_left_close', 'search-page');
3083
+	}
3084 3084
 }
3085 3085
 
3086 3086
 /**
@@ -3093,7 +3093,7 @@  discard block
 block discarded – undo
3093 3093
  */
3094 3094
 function geodir_search_right_section()
3095 3095
 {
3096
-    if (get_option('geodir_show_search_right_section')) { ?>
3096
+	if (get_option('geodir_show_search_right_section')) { ?>
3097 3097
         <div class="geodir-content-right geodir-sidebar-wrap">
3098 3098
             <?php dynamic_sidebar('geodir_search_right_sidebar'); ?>
3099 3099
         </div><!-- end geodir-content-right -->
@@ -3113,18 +3113,18 @@  discard block
 block discarded – undo
3113 3113
  */
3114 3114
 function geodir_action_search_sidebar_right()
3115 3115
 {
3116
-    if (get_option('geodir_show_search_right_section')) {
3117
-        /** This action is documented in geodirectory_template_actions.php */
3118
-        do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3119
-        /**
3120
-         * This is used to add the content to the search page right sidebar (if active).
3121
-         *
3122
-         * @since 1.0.0
3123
-         */
3124
-        do_action('geodir_search_sidebar_right_inside');
3125
-        /** This action is documented in geodirectory_template_actions.php */
3126
-        do_action('geodir_sidebar_right_close', 'search-page');
3127
-    }
3116
+	if (get_option('geodir_show_search_right_section')) {
3117
+		/** This action is documented in geodirectory_template_actions.php */
3118
+		do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3119
+		/**
3120
+		 * This is used to add the content to the search page right sidebar (if active).
3121
+		 *
3122
+		 * @since 1.0.0
3123
+		 */
3124
+		do_action('geodir_search_sidebar_right_inside');
3125
+		/** This action is documented in geodirectory_template_actions.php */
3126
+		do_action('geodir_sidebar_right_close', 'search-page');
3127
+	}
3128 3128
 }
3129 3129
 
3130 3130
 
@@ -3139,11 +3139,11 @@  discard block
 block discarded – undo
3139 3139
  */
3140 3140
 function geodir_action_sidebar_search_bottom_section()
3141 3141
 {
3142
-    if (get_option('geodir_show_search_bottom_section')) { ?>
3142
+	if (get_option('geodir_show_search_bottom_section')) { ?>
3143 3143
         <div
3144 3144
             class="<?php
3145
-            /** This action is documented in geodirectory_template_actions.php */
3146
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3145
+			/** This action is documented in geodirectory_template_actions.php */
3146
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3147 3147
             <?php dynamic_sidebar('geodir_search_bottom'); ?>
3148 3148
         </div><!-- clearfix ends here-->
3149 3149
     <?php }
@@ -3158,14 +3158,14 @@  discard block
 block discarded – undo
3158 3158
  */
3159 3159
 function geodir_action_search_content_inside()
3160 3160
 {
3161
-    global $gridview_columns;
3162
-    $listing_view = get_option('geodir_search_view');
3163
-    if (strstr($listing_view, 'gridview')) {
3164
-        $gridview_columns = $listing_view;
3165
-        $listing_view_exp = explode('_', $listing_view);
3166
-        $listing_view = $listing_view_exp[0];
3167
-    }
3168
-    geodir_get_template_part('listing', 'listview');
3161
+	global $gridview_columns;
3162
+	$listing_view = get_option('geodir_search_view');
3163
+	if (strstr($listing_view, 'gridview')) {
3164
+		$gridview_columns = $listing_view;
3165
+		$listing_view_exp = explode('_', $listing_view);
3166
+		$listing_view = $listing_view_exp[0];
3167
+	}
3168
+	geodir_get_template_part('listing', 'listview');
3169 3169
 }
3170 3170
 
3171 3171
 add_action('geodir_search_content_inside', 'geodir_action_search_content_inside', 10);
@@ -3181,22 +3181,22 @@  discard block
 block discarded – undo
3181 3181
  */
3182 3182
 function geodir_action_search_content()
3183 3183
 {
3184
-    /** This action is documented in geodirectory_template_actions.php */
3185
-    do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3186
-    echo '<div class="clearfix">';
3187
-    /** This action is documented in geodirectory_template_actions.php */
3188
-    do_action('geodir_before_listing');
3189
-    echo '</div>';
3190
-    /**
3191
-     * This is used to add the content to the search page main content.
3192
-     *
3193
-     * @since 1.0.0
3194
-     */
3195
-    do_action('geodir_search_content_inside');
3196
-    /** This action is documented in geodirectory_template_actions.php */
3197
-    do_action('geodir_after_listing');
3198
-    /** This action is documented in geodirectory_template_actions.php */
3199
-    do_action('geodir_main_content_close', 'search-page');
3184
+	/** This action is documented in geodirectory_template_actions.php */
3185
+	do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3186
+	echo '<div class="clearfix">';
3187
+	/** This action is documented in geodirectory_template_actions.php */
3188
+	do_action('geodir_before_listing');
3189
+	echo '</div>';
3190
+	/**
3191
+	 * This is used to add the content to the search page main content.
3192
+	 *
3193
+	 * @since 1.0.0
3194
+	 */
3195
+	do_action('geodir_search_content_inside');
3196
+	/** This action is documented in geodirectory_template_actions.php */
3197
+	do_action('geodir_after_listing');
3198
+	/** This action is documented in geodirectory_template_actions.php */
3199
+	do_action('geodir_main_content_close', 'search-page');
3200 3200
 }
3201 3201
 
3202 3202
 ###############################################
@@ -3219,11 +3219,11 @@  discard block
 block discarded – undo
3219 3219
  */
3220 3220
 function geodir_action_geodir_sidebar_home_top()
3221 3221
 {
3222
-    if (get_option('geodir_show_home_top_section')) { ?>
3222
+	if (get_option('geodir_show_home_top_section')) { ?>
3223 3223
         <div
3224 3224
             class="<?php
3225
-            /** This action is documented in geodirectory_template_actions.php */
3226
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3225
+			/** This action is documented in geodirectory_template_actions.php */
3226
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3227 3227
             <?php dynamic_sidebar('geodir_home_top'); ?>
3228 3228
         </div><!-- clearfix ends here-->
3229 3229
     <?php }
@@ -3239,7 +3239,7 @@  discard block
 block discarded – undo
3239 3239
  */
3240 3240
 function geodir_home_left_section()
3241 3241
 {
3242
-    if (get_option('geodir_show_home_left_section')) { ?>
3242
+	if (get_option('geodir_show_home_left_section')) { ?>
3243 3243
         <div class="geodir-content-left geodir-sidebar-wrap">
3244 3244
             <?php dynamic_sidebar('geodir_home_left'); ?>
3245 3245
         </div><!-- end geodir-content-left -->
@@ -3261,19 +3261,19 @@  discard block
 block discarded – undo
3261 3261
  */
3262 3262
 function geodir_action_home_sidebar_left()
3263 3263
 {
3264
-    if (get_option('geodir_show_home_left_section')) {
3264
+	if (get_option('geodir_show_home_left_section')) {
3265 3265
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3266
-        /** This action is documented in geodirectory_template_actions.php */
3267
-        do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3268
-        /**
3269
-         * This is used to add the content to the home page left sidebar (if active).
3270
-         *
3271
-         * @since 1.0.0
3272
-         */
3273
-        do_action('geodir_home_sidebar_left_inside');
3274
-        /** This action is documented in geodirectory_template_actions.php */
3275
-        do_action('geodir_sidebar_left_close', 'home-page');
3276
-    }
3266
+		/** This action is documented in geodirectory_template_actions.php */
3267
+		do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3268
+		/**
3269
+		 * This is used to add the content to the home page left sidebar (if active).
3270
+		 *
3271
+		 * @since 1.0.0
3272
+		 */
3273
+		do_action('geodir_home_sidebar_left_inside');
3274
+		/** This action is documented in geodirectory_template_actions.php */
3275
+		do_action('geodir_sidebar_left_close', 'home-page');
3276
+	}
3277 3277
 }
3278 3278
 
3279 3279
 /**
@@ -3286,7 +3286,7 @@  discard block
 block discarded – undo
3286 3286
  */
3287 3287
 function geodir_home_right_section()
3288 3288
 {
3289
-    if (get_option('geodir_show_home_right_section')) { ?>
3289
+	if (get_option('geodir_show_home_right_section')) { ?>
3290 3290
         <div class="geodir-content-right geodir-sidebar-wrap">
3291 3291
             <?php dynamic_sidebar('geodir_home_right'); ?>
3292 3292
         </div><!-- end geodir-content-right -->
@@ -3307,18 +3307,18 @@  discard block
 block discarded – undo
3307 3307
  */
3308 3308
 function geodir_action_home_sidebar_right()
3309 3309
 {
3310
-    if (get_option('geodir_show_home_right_section')) {
3311
-        /** This action is documented in geodirectory_template_actions.php */
3312
-        do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3313
-        /**
3314
-         * This is used to add the content to the home page right sidebar (if active).
3315
-         *
3316
-         * @since 1.0.0
3317
-         */
3318
-        do_action('geodir_home_sidebar_right_inside');
3319
-        /** This action is documented in geodirectory_template_actions.php */
3320
-        do_action('geodir_sidebar_right_close', 'home-page');
3321
-    }
3310
+	if (get_option('geodir_show_home_right_section')) {
3311
+		/** This action is documented in geodirectory_template_actions.php */
3312
+		do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3313
+		/**
3314
+		 * This is used to add the content to the home page right sidebar (if active).
3315
+		 *
3316
+		 * @since 1.0.0
3317
+		 */
3318
+		do_action('geodir_home_sidebar_right_inside');
3319
+		/** This action is documented in geodirectory_template_actions.php */
3320
+		do_action('geodir_sidebar_right_close', 'home-page');
3321
+	}
3322 3322
 }
3323 3323
 
3324 3324
 /**
@@ -3329,7 +3329,7 @@  discard block
 block discarded – undo
3329 3329
  */
3330 3330
 function geodir_action_home_content_inside()
3331 3331
 {
3332
-    dynamic_sidebar('geodir_home_content');
3332
+	dynamic_sidebar('geodir_home_content');
3333 3333
 }
3334 3334
 
3335 3335
 add_action('geodir_home_content_inside', 'geodir_action_home_content_inside', 10);
@@ -3344,28 +3344,28 @@  discard block
 block discarded – undo
3344 3344
  */
3345 3345
 function geodir_action_home_content()
3346 3346
 {
3347
-    /** This action is documented in geodirectory_template_actions.php */
3348
-    do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3349
-    /**
3350
-     * This called before the home page main content.
3351
-     *
3352
-     * @since 1.0.0
3353
-     */
3354
-    do_action('geodir_before_home_content');
3355
-    /**
3356
-     * This is used to add the content to the home page main content.
3357
-     *
3358
-     * @since 1.0.0
3359
-     */
3360
-    do_action('geodir_home_content_inside');
3361
-    /**
3362
-     * This is called after the homepage main content.
3363
-     *
3364
-     * @since 1.0.0
3365
-     */
3366
-    do_action('geodir_after_home_content');
3367
-    /** This action is documented in geodirectory_template_actions.php */
3368
-    do_action('geodir_main_content_close', 'home-page');
3347
+	/** This action is documented in geodirectory_template_actions.php */
3348
+	do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3349
+	/**
3350
+	 * This called before the home page main content.
3351
+	 *
3352
+	 * @since 1.0.0
3353
+	 */
3354
+	do_action('geodir_before_home_content');
3355
+	/**
3356
+	 * This is used to add the content to the home page main content.
3357
+	 *
3358
+	 * @since 1.0.0
3359
+	 */
3360
+	do_action('geodir_home_content_inside');
3361
+	/**
3362
+	 * This is called after the homepage main content.
3363
+	 *
3364
+	 * @since 1.0.0
3365
+	 */
3366
+	do_action('geodir_after_home_content');
3367
+	/** This action is documented in geodirectory_template_actions.php */
3368
+	do_action('geodir_main_content_close', 'home-page');
3369 3369
 }
3370 3370
 
3371 3371
 add_action('geodir_sidebar_location_bottom_section', 'geodir_action_sidebar_home_bottom_section', 10);
@@ -3380,11 +3380,11 @@  discard block
 block discarded – undo
3380 3380
  */
3381 3381
 function geodir_action_sidebar_home_bottom_section()
3382 3382
 {
3383
-    if (get_option('geodir_show_home_bottom_section')) { ?>
3383
+	if (get_option('geodir_show_home_bottom_section')) { ?>
3384 3384
         <div
3385 3385
             class="<?php
3386
-            /** This action is documented in geodirectory_template_actions.php */
3387
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3386
+			/** This action is documented in geodirectory_template_actions.php */
3387
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3388 3388
             <?php dynamic_sidebar('geodir_home_bottom'); ?>
3389 3389
         </div><!-- clearfix ends here-->
3390 3390
     <?php }
@@ -3412,13 +3412,13 @@  discard block
 block discarded – undo
3412 3412
  */
3413 3413
 function geodir_filter_listing_page_title($list_title)
3414 3414
 {
3415
-    if (is_search() && trim(get_search_query()) == '') {
3416
-        $gd_post_type = geodir_get_current_posttype();
3417
-        $post_type_info = get_post_type_object($gd_post_type);
3415
+	if (is_search() && trim(get_search_query()) == '') {
3416
+		$gd_post_type = geodir_get_current_posttype();
3417
+		$post_type_info = get_post_type_object($gd_post_type);
3418 3418
 
3419
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3420
-    }
3421
-    return $list_title;
3419
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3420
+	}
3421
+	return $list_title;
3422 3422
 }
3423 3423
 
3424 3424
 add_action('geodir_message_not_found_on_listing', 'geodir_display_message_not_found_on_listing');
@@ -3433,62 +3433,62 @@  discard block
 block discarded – undo
3433 3433
  * @param string $gd_page The geodirectory page type. Default null.
3434 3434
  */
3435 3435
 function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
3436
-    global $post;
3437
-
3438
-    $gd_page_id = NULL;
3439
-    if ($gd_page == 'home-page' && geodir_is_page('home')) {
3440
-        $gd_page_id = geodir_home_page_id();
3441
-    } else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3442
-        $gd_page_id = geodir_preview_page_id();
3443
-    } else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3444
-        $gd_page_id = geodir_add_listing_page_id();
3445
-    } else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3446
-        $gd_page_id = geodir_success_page_id();
3447
-    } else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3448
-        $gd_page_id = geodir_location_page_id();
3449
-    } else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3450
-        $gd_page_id = geodir_info_page_id();
3451
-    } else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3452
-        $gd_page_id = geodir_login_page_id();
3453
-    } else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3454
-        $gd_page_id = geodir_payment_checkout_page_id();
3455
-    } else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3456
-        $gd_page_id = geodir_payment_invoices_page_id();
3457
-    }
3458
-
3459
-    if (!$gd_page_id > 0) {
3460
-        return;
3461
-    }
3436
+	global $post;
3437
+
3438
+	$gd_page_id = NULL;
3439
+	if ($gd_page == 'home-page' && geodir_is_page('home')) {
3440
+		$gd_page_id = geodir_home_page_id();
3441
+	} else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3442
+		$gd_page_id = geodir_preview_page_id();
3443
+	} else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3444
+		$gd_page_id = geodir_add_listing_page_id();
3445
+	} else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3446
+		$gd_page_id = geodir_success_page_id();
3447
+	} else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3448
+		$gd_page_id = geodir_location_page_id();
3449
+	} else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3450
+		$gd_page_id = geodir_info_page_id();
3451
+	} else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3452
+		$gd_page_id = geodir_login_page_id();
3453
+	} else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3454
+		$gd_page_id = geodir_payment_checkout_page_id();
3455
+	} else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3456
+		$gd_page_id = geodir_payment_invoices_page_id();
3457
+	}
3458
+
3459
+	if (!$gd_page_id > 0) {
3460
+		return;
3461
+	}
3462 3462
     
3463
-    $display = 'before';
3464
-    /**
3465
-     * Filter the position to display the page content.
3466
-     *
3467
-     * @since 1.6.3
3468
-     *
3469
-     * @param string $display Position to add the post content.
3470
-     * @param string $gd_page The geodirectory page type.
3471
-     */
3472
-    $display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3473
-
3474
-    if ($position !== $display) {
3475
-        return;
3476
-    }
3477
-
3478
-    $gd_post = $post;
3463
+	$display = 'before';
3464
+	/**
3465
+	 * Filter the position to display the page content.
3466
+	 *
3467
+	 * @since 1.6.3
3468
+	 *
3469
+	 * @param string $display Position to add the post content.
3470
+	 * @param string $gd_page The geodirectory page type.
3471
+	 */
3472
+	$display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3473
+
3474
+	if ($position !== $display) {
3475
+		return;
3476
+	}
3477
+
3478
+	$gd_post = $post;
3479 3479
     
3480
-    setup_postdata(get_post($gd_page_id));
3480
+	setup_postdata(get_post($gd_page_id));
3481 3481
 
3482
-    if (get_the_content()) {
3483
-        ?>
3482
+	if (get_the_content()) {
3483
+		?>
3484 3484
         <section class="entry-content clearfix" itemprop="articleBody"><?php the_content(); ?></section>
3485 3485
         <?php
3486
-    }
3486
+	}
3487 3487
 
3488
-    $post = $gd_post;
3489
-    if (!empty($gd_post) && is_object($gd_post)) {
3490
-        setup_postdata($gd_post);
3491
-    }
3488
+	$post = $gd_post;
3489
+	if (!empty($gd_post) && is_object($gd_post)) {
3490
+		setup_postdata($gd_post);
3491
+	}
3492 3492
 
3493 3493
 }
3494 3494
 add_action('geodir_add_page_content', 'geodir_add_page_content', 10, 2);
3495 3495
\ No newline at end of file
Please login to merge, or discard this patch.