Test Failed
Pull Request — master (#316)
by Kiran
17:44
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   +517 added lines, -517 removed lines patch added patch discarded remove patch
@@ -14,280 +14,280 @@  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
-        if (is_tax()) {
157
-            $taxonomy = get_query_var('taxonomy');
158
-            $cur_term = get_query_var('term');
159
-            $term_data = get_term_by('name', $cur_term, $taxonomy);
160
-            $term_args['parent'] = $term_data->term_id;
161
-        }
162
-
163
-        $terms = get_terms($category_taxonomy[0], $term_args);
164
-
165
-        $term_reviews = geodir_count_reviews_by_terms();
166
-        $a_terms = array();
167
-        foreach ($terms as $term) {
168
-
169
-
170
-            if ($term->count > 0) {
171
-                if (isset($term_reviews[$term->term_id])) {
172
-                    $term->review_count = $term_reviews[$term->term_id];
173
-                } else {
174
-                    $term->review_count = '0';
175
-                }
176
-
177
-                $a_terms[] = $term;
178
-            }
179
-
180
-        }
181
-
182
-
183
-        $terms = geodir_sort_terms($a_terms, 'review_count');
184
-
185
-        $query_args = array(
186
-            'posts_per_page' => $post_limit,
187
-            'is_geodir_loop' => true,
188
-            'post_type' => $post_type,
189
-            'gd_location' => $add_location_filter ? true : false,
190
-            'order_by' => 'high_review'
191
-        );
192
-        if ($character_count >= 0) {
193
-            $query_args['excerpt_length'] = $character_count;
194
-        }
195
-
196
-        $layout = array();
197
-        if ($tab_layout == 'bestof-tabs-as-dropdown') {
198
-            $layout[] = $tab_layout;
199
-        } else {
200
-            $layout[] = 'bestof-tabs-as-dropdown';
201
-            $layout[] = $tab_layout;
202
-        }
203
-
204
-
205
-        echo $before_title . __($title,'geodirectory') . $after_title;
206
-
207
-        //term navigation - start
208
-        echo '<div class="geodir-tabs gd-bestof-tabs" id="gd-bestof-tabs" style="position:relative;">';
209
-
210
-        $final_html = '';
211
-        foreach ($layout as $tab_layout) {
212
-            $nav_html = '';
213
-            $is_dropdown = ($tab_layout == 'bestof-tabs-as-dropdown') ? true : false;
214
-
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')) . '">';
217
-            } else {
218
-                $nav_html .= '<dl class="geodir-tab-head geodir-bestof-cat-list">';
219
-                $nav_html .= '<dt></dt>';
220
-            }
221
-
222
-
223
-            $term_icon = geodir_get_term_icon();
224
-            $cat_count = 0;
225
-            if (!empty($terms)) {
226
-                foreach ($terms as $cat) {
227
-                    $cat_count++;
228
-                    if ($cat_count > $categ_limit) {
229
-                        break;
230
-                    }
231
-                    if ($is_dropdown) {
232
-                        $selected = ($cat_count == 1) ? 'selected="selected"' : '';
233
-                        $nav_html .= '<option ' . $selected . ' value="' . $cat->term_id . '">' . geodir_ucwords($cat->name) . '</option>';
234
-                    } else {
235
-                        if ($cat_count == 1) {
236
-                            $nav_html .= '<dd class="geodir-tab-active">';
237
-                        } else {
238
-                            $nav_html .= '<dd class="">';
239
-                        }
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 . '"/>';
243
-                        $nav_html .= '<span>';
244
-                        $nav_html .= geodir_ucwords($cat->name);
245
-                        $nav_html .= '<small>';
246
-                        if (isset($cat->review_count)) {
247
-                            $num_reviews = $cat->review_count;
248
-                            if ($num_reviews == 0) {
249
-                                $reviews = __('No Reviews', 'geodirectory');
250
-                            } elseif ($num_reviews > 1) {
251
-                                $reviews = $num_reviews . __(' Reviews', 'geodirectory');
252
-                            } else {
253
-                                $reviews = __('1 Review', 'geodirectory');
254
-                            }
255
-                            $nav_html .= $reviews;
256
-                        }
257
-                        $nav_html .= '</small>';
258
-                        $nav_html .= '</span>';
259
-                        $nav_html .= '</a>';
260
-                        $nav_html .= '</dd>';
261
-                    }
262
-                }
263
-            }
264
-
265
-            if ($is_dropdown) {
266
-                $nav_html .= '</select>';
267
-            } else {
268
-                $nav_html .= '</dl>';
269
-            }
270
-            $final_html .= $nav_html;
271
-        }
272
-        if ($terms) {
273
-            echo $final_html;
274
-        }
275
-        echo '</div>';
276
-        //term navigation - end
277
-
278
-        //first term listings by default - start
279
-        $first_term = '';
280
-        if ($terms) {
281
-            $first_term = $terms[0];
282
-            $tax_query = array(
283
-                'taxonomy' => $category_taxonomy[0],
284
-                'field' => 'id',
285
-                'terms' => $first_term->term_id
286
-            );
287
-            $query_args['tax_query'] = array($tax_query);
288
-        }
289
-
290
-        ?>
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
+		if (is_tax()) {
157
+			$taxonomy = get_query_var('taxonomy');
158
+			$cur_term = get_query_var('term');
159
+			$term_data = get_term_by('name', $cur_term, $taxonomy);
160
+			$term_args['parent'] = $term_data->term_id;
161
+		}
162
+
163
+		$terms = get_terms($category_taxonomy[0], $term_args);
164
+
165
+		$term_reviews = geodir_count_reviews_by_terms();
166
+		$a_terms = array();
167
+		foreach ($terms as $term) {
168
+
169
+
170
+			if ($term->count > 0) {
171
+				if (isset($term_reviews[$term->term_id])) {
172
+					$term->review_count = $term_reviews[$term->term_id];
173
+				} else {
174
+					$term->review_count = '0';
175
+				}
176
+
177
+				$a_terms[] = $term;
178
+			}
179
+
180
+		}
181
+
182
+
183
+		$terms = geodir_sort_terms($a_terms, 'review_count');
184
+
185
+		$query_args = array(
186
+			'posts_per_page' => $post_limit,
187
+			'is_geodir_loop' => true,
188
+			'post_type' => $post_type,
189
+			'gd_location' => $add_location_filter ? true : false,
190
+			'order_by' => 'high_review'
191
+		);
192
+		if ($character_count >= 0) {
193
+			$query_args['excerpt_length'] = $character_count;
194
+		}
195
+
196
+		$layout = array();
197
+		if ($tab_layout == 'bestof-tabs-as-dropdown') {
198
+			$layout[] = $tab_layout;
199
+		} else {
200
+			$layout[] = 'bestof-tabs-as-dropdown';
201
+			$layout[] = $tab_layout;
202
+		}
203
+
204
+
205
+		echo $before_title . __($title,'geodirectory') . $after_title;
206
+
207
+		//term navigation - start
208
+		echo '<div class="geodir-tabs gd-bestof-tabs" id="gd-bestof-tabs" style="position:relative;">';
209
+
210
+		$final_html = '';
211
+		foreach ($layout as $tab_layout) {
212
+			$nav_html = '';
213
+			$is_dropdown = ($tab_layout == 'bestof-tabs-as-dropdown') ? true : false;
214
+
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')) . '">';
217
+			} else {
218
+				$nav_html .= '<dl class="geodir-tab-head geodir-bestof-cat-list">';
219
+				$nav_html .= '<dt></dt>';
220
+			}
221
+
222
+
223
+			$term_icon = geodir_get_term_icon();
224
+			$cat_count = 0;
225
+			if (!empty($terms)) {
226
+				foreach ($terms as $cat) {
227
+					$cat_count++;
228
+					if ($cat_count > $categ_limit) {
229
+						break;
230
+					}
231
+					if ($is_dropdown) {
232
+						$selected = ($cat_count == 1) ? 'selected="selected"' : '';
233
+						$nav_html .= '<option ' . $selected . ' value="' . $cat->term_id . '">' . geodir_ucwords($cat->name) . '</option>';
234
+					} else {
235
+						if ($cat_count == 1) {
236
+							$nav_html .= '<dd class="geodir-tab-active">';
237
+						} else {
238
+							$nav_html .= '<dd class="">';
239
+						}
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 . '"/>';
243
+						$nav_html .= '<span>';
244
+						$nav_html .= geodir_ucwords($cat->name);
245
+						$nav_html .= '<small>';
246
+						if (isset($cat->review_count)) {
247
+							$num_reviews = $cat->review_count;
248
+							if ($num_reviews == 0) {
249
+								$reviews = __('No Reviews', 'geodirectory');
250
+							} elseif ($num_reviews > 1) {
251
+								$reviews = $num_reviews . __(' Reviews', 'geodirectory');
252
+							} else {
253
+								$reviews = __('1 Review', 'geodirectory');
254
+							}
255
+							$nav_html .= $reviews;
256
+						}
257
+						$nav_html .= '</small>';
258
+						$nav_html .= '</span>';
259
+						$nav_html .= '</a>';
260
+						$nav_html .= '</dd>';
261
+					}
262
+				}
263
+			}
264
+
265
+			if ($is_dropdown) {
266
+				$nav_html .= '</select>';
267
+			} else {
268
+				$nav_html .= '</dl>';
269
+			}
270
+			$final_html .= $nav_html;
271
+		}
272
+		if ($terms) {
273
+			echo $final_html;
274
+		}
275
+		echo '</div>';
276
+		//term navigation - end
277
+
278
+		//first term listings by default - start
279
+		$first_term = '';
280
+		if ($terms) {
281
+			$first_term = $terms[0];
282
+			$tax_query = array(
283
+				'taxonomy' => $category_taxonomy[0],
284
+				'field' => 'id',
285
+				'terms' => $first_term->term_id
286
+			);
287
+			$query_args['tax_query'] = array($tax_query);
288
+		}
289
+
290
+		?>
291 291
         <input type="hidden" id="bestof_widget_post_type" name="bestof_widget_post_type"
292 292
                value="<?php echo $post_type; ?>">
293 293
         <input type="hidden" id="bestof_widget_excerpt_type" name="bestof_widget_excerpt_type"
@@ -298,110 +298,110 @@  discard block
 block discarded – undo
298 298
                value="<?php echo $category_taxonomy[0]; ?>">
299 299
         <input type="hidden" id="bestof_widget_location_filter" name="bestof_widget_location_filter"
300 300
                value="<?php if ($add_location_filter) {
301
-                   echo 1;
302
-               } else {
303
-                   echo 0;
304
-               } ?>">
301
+				   echo 1;
302
+			   } else {
303
+				   echo 0;
304
+			   } ?>">
305 305
         <input type="hidden" id="bestof_widget_char_count" name="bestof_widget_char_count"
306 306
                value="<?php echo $character_count; ?>">
307 307
         <div class="geo-bestof-contentwrap geodir-tabs-content" style="position: relative; z-index: 0;">
308 308
             <p id="geodir-bestof-loading" class="geodir-bestof-loading"><i class="fa fa-cog fa-spin"></i></p>
309 309
             <?php
310
-            echo '<div id="geodir-bestof-places">';
311
-            if ($terms) {
312
-                $view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($first_term, $first_term->taxonomy));
313
-                /**
314
-                 * Filter the page link to view all lisitngs.
315
-                 *
316
-                 * @since 1.5.1
317
-                 *
318
-                 * @param array $view_all_link View all listings page link.
319
-                 * @param array $post_type The Post type.
320
-                 * @param array $first_term The category term object.
321
-                 */
322
-                $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $first_term);
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>';
325
-            }
326
-            if ($excerpt_type == 'show-reviews') {
327
-                add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
328
-            }
329
-            geodir_bestof_places_by_term($query_args);
330
-            if ($excerpt_type == 'show-reviews') {
331
-                remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
332
-            }
333
-            echo "</div>";
334
-            ?>
310
+			echo '<div id="geodir-bestof-places">';
311
+			if ($terms) {
312
+				$view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($first_term, $first_term->taxonomy));
313
+				/**
314
+				 * Filter the page link to view all lisitngs.
315
+				 *
316
+				 * @since 1.5.1
317
+				 *
318
+				 * @param array $view_all_link View all listings page link.
319
+				 * @param array $post_type The Post type.
320
+				 * @param array $first_term The category term object.
321
+				 */
322
+				$view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $first_term);
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>';
325
+			}
326
+			if ($excerpt_type == 'show-reviews') {
327
+				add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
328
+			}
329
+			geodir_bestof_places_by_term($query_args);
330
+			if ($excerpt_type == 'show-reviews') {
331
+				remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
332
+			}
333
+			echo "</div>";
334
+			?>
335 335
         </div>
336 336
         <?php //first term listings by default - end
337
-        ?>
337
+		?>
338 338
         <?php echo $after_widget;
339
-        echo "</div>";
340
-    }
341
-
342
-    /**
343
-     * Sanitize best of widget form values as they are saved.
344
-     *
345
-     * @since 1.3.9
346
-     * @since 1.5.1 Declare function public.
347
-     *
348
-     * @param array $new_instance Values just sent to be saved.
349
-     * @param array $old_instance Previously saved values from database.
350
-     *
351
-     * @return array Updated safe values to be saved.
352
-     */
353
-    public function update($new_instance, $old_instance)
354
-    {
355
-        $instance = $old_instance;
356
-        $instance['title'] = strip_tags($new_instance['title']);
357
-        $instance['post_type'] = strip_tags($new_instance['post_type']);
358
-        $instance['post_limit'] = strip_tags($new_instance['post_limit']);
359
-        $instance['categ_limit'] = strip_tags($new_instance['categ_limit']);
360
-        $instance['character_count'] = $new_instance['character_count'];
361
-        $instance['tab_layout'] = $new_instance['tab_layout'];
362
-        $instance['excerpt_type'] = $new_instance['excerpt_type'];
363
-        if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '')
364
-            $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']);
365
-        else
366
-            $instance['add_location_filter'] = '0';
367
-        $instance['use_viewing_post_type'] = isset($new_instance['use_viewing_post_type']) && $new_instance['use_viewing_post_type'] ? 1 : 0;
368
-        return $instance;
369
-    }
370
-
371
-    /**
372
-     * Back-end best of widget settings form.
373
-     *
374
-     * @since 1.3.9
375
-     * @since 1.5.1 Declare function public.
376
-     *
377
-     * @param array $instance Previously saved values from database.
378
-     */
379
-    public function form($instance)
380
-    {
381
-        $instance = wp_parse_args((array)$instance,
382
-            array(
383
-                'title' => '',
384
-                'post_type' => '',
385
-                'post_limit' => '5',
386
-                'categ_limit' => '3',
387
-                'character_count' => '20',
388
-                'add_location_filter' => '1',
389
-                'tab_layout' => 'bestof-tabs-on-top',
390
-                'excerpt_type' => 'show-desc',
391
-                'use_viewing_post_type' => ''
392
-            )
393
-        );
394
-        $title = strip_tags($instance['title']);
395
-        $post_type = strip_tags($instance['post_type']);
396
-        $post_limit = strip_tags($instance['post_limit']);
397
-        $categ_limit = strip_tags($instance['categ_limit']);
398
-        $character_count = strip_tags($instance['character_count']);
399
-        $tab_layout = strip_tags($instance['tab_layout']);
400
-        $excerpt_type = strip_tags($instance['excerpt_type']);
401
-        $add_location_filter = strip_tags($instance['add_location_filter']);
402
-        $use_viewing_post_type = isset($instance['use_viewing_post_type']) && $instance['use_viewing_post_type'] ? true : false;
403
-
404
-        ?>
339
+		echo "</div>";
340
+	}
341
+
342
+	/**
343
+	 * Sanitize best of widget form values as they are saved.
344
+	 *
345
+	 * @since 1.3.9
346
+	 * @since 1.5.1 Declare function public.
347
+	 *
348
+	 * @param array $new_instance Values just sent to be saved.
349
+	 * @param array $old_instance Previously saved values from database.
350
+	 *
351
+	 * @return array Updated safe values to be saved.
352
+	 */
353
+	public function update($new_instance, $old_instance)
354
+	{
355
+		$instance = $old_instance;
356
+		$instance['title'] = strip_tags($new_instance['title']);
357
+		$instance['post_type'] = strip_tags($new_instance['post_type']);
358
+		$instance['post_limit'] = strip_tags($new_instance['post_limit']);
359
+		$instance['categ_limit'] = strip_tags($new_instance['categ_limit']);
360
+		$instance['character_count'] = $new_instance['character_count'];
361
+		$instance['tab_layout'] = $new_instance['tab_layout'];
362
+		$instance['excerpt_type'] = $new_instance['excerpt_type'];
363
+		if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '')
364
+			$instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']);
365
+		else
366
+			$instance['add_location_filter'] = '0';
367
+		$instance['use_viewing_post_type'] = isset($new_instance['use_viewing_post_type']) && $new_instance['use_viewing_post_type'] ? 1 : 0;
368
+		return $instance;
369
+	}
370
+
371
+	/**
372
+	 * Back-end best of widget settings form.
373
+	 *
374
+	 * @since 1.3.9
375
+	 * @since 1.5.1 Declare function public.
376
+	 *
377
+	 * @param array $instance Previously saved values from database.
378
+	 */
379
+	public function form($instance)
380
+	{
381
+		$instance = wp_parse_args((array)$instance,
382
+			array(
383
+				'title' => '',
384
+				'post_type' => '',
385
+				'post_limit' => '5',
386
+				'categ_limit' => '3',
387
+				'character_count' => '20',
388
+				'add_location_filter' => '1',
389
+				'tab_layout' => 'bestof-tabs-on-top',
390
+				'excerpt_type' => 'show-desc',
391
+				'use_viewing_post_type' => ''
392
+			)
393
+		);
394
+		$title = strip_tags($instance['title']);
395
+		$post_type = strip_tags($instance['post_type']);
396
+		$post_limit = strip_tags($instance['post_limit']);
397
+		$categ_limit = strip_tags($instance['categ_limit']);
398
+		$character_count = strip_tags($instance['character_count']);
399
+		$tab_layout = strip_tags($instance['tab_layout']);
400
+		$excerpt_type = strip_tags($instance['excerpt_type']);
401
+		$add_location_filter = strip_tags($instance['add_location_filter']);
402
+		$use_viewing_post_type = isset($instance['use_viewing_post_type']) && $instance['use_viewing_post_type'] ? true : false;
403
+
404
+		?>
405 405
         <p>
406 406
             <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?>
407 407
 
@@ -416,14 +416,14 @@  discard block
 block discarded – undo
416 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
-                /**
420
-                 * Filter the post types to display in widget.
421
-                 *
422
-                 * @since 1.3.9
423
-                 *
424
-                 * @param array $postypes Post types array.
425
-                 */
426
-                $postypes = apply_filters('geodir_post_type_list_in_p_widget', $postypes); ?>
419
+				/**
420
+				 * Filter the post types to display in widget.
421
+				 *
422
+				 * @since 1.3.9
423
+				 *
424
+				 * @param array $postypes Post types array.
425
+				 */
426
+				$postypes = apply_filters('geodir_post_type_list_in_p_widget', $postypes); ?>
427 427
 
428 428
                 <select class="widefat" id="<?php echo $this->get_field_id('post_type'); ?>"
429 429
                         name="<?php echo $this->get_field_name('post_type'); ?>"
@@ -432,9 +432,9 @@  discard block
 block discarded – undo
432 432
                     <?php foreach ($postypes as $postypes_obj) { ?>
433 433
 
434 434
                         <option <?php if ($post_type == $postypes_obj) {
435
-                            echo 'selected="selected"';
436
-                        } ?> value="<?php echo $postypes_obj; ?>"><?php $extvalue = explode('_', $postypes_obj);
437
-                            echo ucfirst($extvalue[1]); ?></option>
435
+							echo 'selected="selected"';
436
+						} ?> value="<?php echo $postypes_obj; ?>"><?php $extvalue = explode('_', $postypes_obj);
437
+							echo ucfirst($extvalue[1]); ?></option>
438 438
 
439 439
                     <?php } ?>
440 440
 
@@ -480,14 +480,14 @@  discard block
 block discarded – undo
480 480
                         name="<?php echo $this->get_field_name('tab_layout'); ?>">
481 481
 
482 482
                     <option <?php if ($tab_layout == 'bestof-tabs-on-top') {
483
-                        echo 'selected="selected"';
484
-                    } ?> value="bestof-tabs-on-top"><?php _e('Tabs on Top', 'geodirectory'); ?></option>
483
+						echo 'selected="selected"';
484
+					} ?> value="bestof-tabs-on-top"><?php _e('Tabs on Top', 'geodirectory'); ?></option>
485 485
                     <option <?php if ($tab_layout == 'bestof-tabs-on-left') {
486
-                        echo 'selected="selected"';
487
-                    } ?> value="bestof-tabs-on-left"><?php _e('Tabs on Left', 'geodirectory'); ?></option>
486
+						echo 'selected="selected"';
487
+					} ?> value="bestof-tabs-on-left"><?php _e('Tabs on Left', 'geodirectory'); ?></option>
488 488
                     <option <?php if ($tab_layout == 'bestof-tabs-as-dropdown') {
489
-                        echo 'selected="selected"';
490
-                    } ?>
489
+						echo 'selected="selected"';
490
+					} ?>
491 491
                         value="bestof-tabs-as-dropdown"><?php _e('Tabs as Dropdown', 'geodirectory'); ?></option>
492 492
                 </select>
493 493
             </label>
@@ -501,11 +501,11 @@  discard block
 block discarded – undo
501 501
                         name="<?php echo $this->get_field_name('excerpt_type'); ?>">
502 502
 
503 503
                     <option <?php if ($excerpt_type == 'show-desc') {
504
-                        echo 'selected="selected"';
505
-                    } ?> value="show-desc"><?php _e('Show Description', 'geodirectory'); ?></option>
504
+						echo 'selected="selected"';
505
+					} ?> value="show-desc"><?php _e('Show Description', 'geodirectory'); ?></option>
506 506
                     <option <?php if ($excerpt_type == 'show-reviews') {
507
-                        echo 'selected="selected"';
508
-                    } ?> value="show-reviews"><?php _e('Show Reviews if Available', 'geodirectory'); ?></option>
507
+						echo 'selected="selected"';
508
+					} ?> value="show-reviews"><?php _e('Show Reviews if Available', 'geodirectory'); ?></option>
509 509
                 </select>
510 510
             </label>
511 511
         </p>
@@ -524,12 +524,12 @@  discard block
 block discarded – undo
524 524
                 for="<?php echo $this->get_field_id('use_viewing_post_type'); ?>"><?php _e('Use current viewing post type:', 'geodirectory'); ?>
525 525
                 <input type="checkbox" id="<?php echo $this->get_field_id('use_viewing_post_type'); ?>"
526 526
                        name="<?php echo $this->get_field_name('use_viewing_post_type'); ?>" <?php if ($use_viewing_post_type) {
527
-                    echo 'checked="checked"';
528
-                } ?>  value="1"/>
527
+					echo 'checked="checked"';
528
+				} ?>  value="1"/>
529 529
             </label>
530 530
         </p>
531 531
     <?php
532
-    }
532
+	}
533 533
 } // class geodir_bestof_widget
534 534
 
535 535
 register_widget('geodir_bestof_widget');
@@ -549,68 +549,68 @@  discard block
 block discarded – undo
549 549
  */
550 550
 function geodir_bestof_places_by_term($query_args)
551 551
 {
552
-    global $gd_session;
553
-
554
-    /**
555
-     * This action called before querying widget listings.
556
-     *
557
-     * @since 1.0.0
558
-     */
559
-    do_action('geodir_bestof_get_widget_listings_before');
560
-
561
-    $widget_listings = geodir_get_widget_listings($query_args);
562
-
563
-    /**
564
-     * This action called after querying widget listings.
565
-     *
566
-     * @since 1.0.0
567
-     */
568
-    do_action('geodir_bestof_get_widget_listings_after');
569
-
570
-    $character_count = isset($query_args['excerpt_length']) ? $query_args['excerpt_length'] : '';
571
-
572
-    if (!isset($character_count)) {
573
-        /** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */
574
-        $character_count = $character_count == '' ? 50 : apply_filters('bestof_widget_character_count', $character_count);
575
-    }
576
-
577
-    /** This filter is documented in geodirectory-functions/general_functions.php */
578
-    $template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview'));
579
-
580
-    global $post, $map_jason, $map_canvas_arr, $gridview_columns_widget, $geodir_is_widget_listing;
581
-    $current_post = $post;
582
-    $current_map_jason = $map_jason;
583
-    $current_map_canvas_arr = $map_canvas_arr;
584
-    $current_grid_view = $gridview_columns_widget;
585
-    $gridview_columns_widget = null;
586
-
587
-    $gd_listing_view_set = $gd_session->get('gd_listing_view') ? true : false;
588
-    $gd_listing_view_old = $gd_listing_view_set ? $gd_session->get('gd_listing_view') : '';
589
-
590
-    $gd_session->set('gd_listing_view', '1');
591
-    $geodir_is_widget_listing = true;
592
-
593
-    /**
594
-     * Includes the template for the listing listview.
595
-     *
596
-     * @since 1.3.9
597
-     */
598
-    include($template);
599
-
600
-    $geodir_is_widget_listing = false;
601
-
602
-    $GLOBALS['post'] = $current_post;
603
-    if (!empty($current_post)) {
604
-        setup_postdata($current_post);
605
-    }
606
-    if ($gd_listing_view_set) { // Set back previous value
607
-        $gd_session->set('gd_listing_view', $gd_listing_view_old);
608
-    } else {
609
-        $gd_session->un_set('gd_listing_view');
610
-    }
611
-    $map_jason = $current_map_jason;
612
-    $map_canvas_arr = $current_map_canvas_arr;
613
-    $gridview_columns_widget = $current_grid_view;
552
+	global $gd_session;
553
+
554
+	/**
555
+	 * This action called before querying widget listings.
556
+	 *
557
+	 * @since 1.0.0
558
+	 */
559
+	do_action('geodir_bestof_get_widget_listings_before');
560
+
561
+	$widget_listings = geodir_get_widget_listings($query_args);
562
+
563
+	/**
564
+	 * This action called after querying widget listings.
565
+	 *
566
+	 * @since 1.0.0
567
+	 */
568
+	do_action('geodir_bestof_get_widget_listings_after');
569
+
570
+	$character_count = isset($query_args['excerpt_length']) ? $query_args['excerpt_length'] : '';
571
+
572
+	if (!isset($character_count)) {
573
+		/** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */
574
+		$character_count = $character_count == '' ? 50 : apply_filters('bestof_widget_character_count', $character_count);
575
+	}
576
+
577
+	/** This filter is documented in geodirectory-functions/general_functions.php */
578
+	$template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview'));
579
+
580
+	global $post, $map_jason, $map_canvas_arr, $gridview_columns_widget, $geodir_is_widget_listing;
581
+	$current_post = $post;
582
+	$current_map_jason = $map_jason;
583
+	$current_map_canvas_arr = $map_canvas_arr;
584
+	$current_grid_view = $gridview_columns_widget;
585
+	$gridview_columns_widget = null;
586
+
587
+	$gd_listing_view_set = $gd_session->get('gd_listing_view') ? true : false;
588
+	$gd_listing_view_old = $gd_listing_view_set ? $gd_session->get('gd_listing_view') : '';
589
+
590
+	$gd_session->set('gd_listing_view', '1');
591
+	$geodir_is_widget_listing = true;
592
+
593
+	/**
594
+	 * Includes the template for the listing listview.
595
+	 *
596
+	 * @since 1.3.9
597
+	 */
598
+	include($template);
599
+
600
+	$geodir_is_widget_listing = false;
601
+
602
+	$GLOBALS['post'] = $current_post;
603
+	if (!empty($current_post)) {
604
+		setup_postdata($current_post);
605
+	}
606
+	if ($gd_listing_view_set) { // Set back previous value
607
+		$gd_session->set('gd_listing_view', $gd_listing_view_old);
608
+	} else {
609
+		$gd_session->un_set('gd_listing_view');
610
+	}
611
+	$map_jason = $current_map_jason;
612
+	$map_canvas_arr = $current_map_canvas_arr;
613
+	$gridview_columns_widget = $current_grid_view;
614 614
 }
615 615
 
616 616
 //Ajax functions
@@ -627,51 +627,51 @@  discard block
 block discarded – undo
627 627
  */
628 628
 function geodir_bestof_callback()
629 629
 {
630
-    check_ajax_referer('geodir-bestof-nonce', 'geodir_bestof_nonce');
631
-    //set variables
632
-    $post_type = strip_tags(esc_sql($_POST['post_type']));
633
-    $post_limit = strip_tags(esc_sql($_POST['post_limit']));
634
-    $character_count = strip_tags(esc_sql($_POST['char_count']));
635
-    $taxonomy = strip_tags(esc_sql($_POST['taxonomy']));
636
-    $add_location_filter = strip_tags(esc_sql($_POST['add_location_filter']));
637
-    $term_id = strip_tags(esc_sql($_POST['term_id']));
638
-    $excerpt_type = strip_tags(esc_sql($_POST['excerpt_type']));
639
-
640
-    $query_args = array(
641
-        'posts_per_page' => $post_limit,
642
-        'is_geodir_loop' => true,
643
-        'post_type' => $post_type,
644
-        'gd_location' => $add_location_filter ? true : false,
645
-        'order_by' => 'high_review'
646
-    );
647
-
648
-    if ($character_count >= 0) {
649
-        $query_args['excerpt_length'] = $character_count;
650
-    }
651
-
652
-    $tax_query = array(
653
-        'taxonomy' => $taxonomy,
654
-        'field' => 'id',
655
-        'terms' => $term_id
656
-    );
657
-
658
-    $query_args['tax_query'] = array($tax_query);
659
-    if ($term_id && $taxonomy) {
660
-        $term = get_term_by('id', $term_id, $taxonomy);
661
-        $view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($term));
662
-        /** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */
663
-        $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $term);
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>';
666
-    }
667
-    if ($excerpt_type == 'show-reviews') {
668
-        add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
669
-    }
670
-    geodir_bestof_places_by_term($query_args);
671
-    if ($excerpt_type == 'show-reviews') {
672
-        remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
673
-    }
674
-    gd_die();
630
+	check_ajax_referer('geodir-bestof-nonce', 'geodir_bestof_nonce');
631
+	//set variables
632
+	$post_type = strip_tags(esc_sql($_POST['post_type']));
633
+	$post_limit = strip_tags(esc_sql($_POST['post_limit']));
634
+	$character_count = strip_tags(esc_sql($_POST['char_count']));
635
+	$taxonomy = strip_tags(esc_sql($_POST['taxonomy']));
636
+	$add_location_filter = strip_tags(esc_sql($_POST['add_location_filter']));
637
+	$term_id = strip_tags(esc_sql($_POST['term_id']));
638
+	$excerpt_type = strip_tags(esc_sql($_POST['excerpt_type']));
639
+
640
+	$query_args = array(
641
+		'posts_per_page' => $post_limit,
642
+		'is_geodir_loop' => true,
643
+		'post_type' => $post_type,
644
+		'gd_location' => $add_location_filter ? true : false,
645
+		'order_by' => 'high_review'
646
+	);
647
+
648
+	if ($character_count >= 0) {
649
+		$query_args['excerpt_length'] = $character_count;
650
+	}
651
+
652
+	$tax_query = array(
653
+		'taxonomy' => $taxonomy,
654
+		'field' => 'id',
655
+		'terms' => $term_id
656
+	);
657
+
658
+	$query_args['tax_query'] = array($tax_query);
659
+	if ($term_id && $taxonomy) {
660
+		$term = get_term_by('id', $term_id, $taxonomy);
661
+		$view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($term));
662
+		/** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */
663
+		$view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $term);
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>';
666
+	}
667
+	if ($excerpt_type == 'show-reviews') {
668
+		add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
669
+	}
670
+	geodir_bestof_places_by_term($query_args);
671
+	if ($excerpt_type == 'show-reviews') {
672
+		remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
673
+	}
674
+	gd_die();
675 675
 }
676 676
 
677 677
 //Javascript
@@ -684,8 +684,8 @@  discard block
 block discarded – undo
684 684
  */
685 685
 function geodir_bestof_js()
686 686
 {
687
-    $ajax_nonce = wp_create_nonce("geodir-bestof-nonce");
688
-    ?>
687
+	$ajax_nonce = wp_create_nonce("geodir-bestof-nonce");
688
+	?>
689 689
     <script type="text/javascript">
690 690
         jQuery(document).ready(function () {
691 691
             jQuery('.geodir-bestof-cat-list a, #geodir_bestof_tab_dd').on("click change", function (e) {
@@ -758,18 +758,18 @@  discard block
 block discarded – undo
758 758
 
759 759
 function best_of_show_review_in_excerpt($excerpt)
760 760
 {
761
-    global $wpdb, $post;
762
-    $review_table = GEODIR_REVIEW_TABLE;
763
-    $request = "SELECT comment_ID FROM $review_table WHERE post_id = $post->ID ORDER BY post_date DESC, id DESC LIMIT 1";
764
-    $comments = $wpdb->get_results($request);
765
-
766
-    if ($comments) {
767
-        foreach ($comments as $comment) {
768
-            // Set the extra comment info needed.
769
-            $comment_extra = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID");
770
-            $comment_content = $comment_extra->comment_content;
771
-            $excerpt = strip_tags($comment_content);
772
-        }
773
-    }
774
-    return $excerpt;
761
+	global $wpdb, $post;
762
+	$review_table = GEODIR_REVIEW_TABLE;
763
+	$request = "SELECT comment_ID FROM $review_table WHERE post_id = $post->ID ORDER BY post_date DESC, id DESC LIMIT 1";
764
+	$comments = $wpdb->get_results($request);
765
+
766
+	if ($comments) {
767
+		foreach ($comments as $comment) {
768
+			// Set the extra comment info needed.
769
+			$comment_extra = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID");
770
+			$comment_content = $comment_extra->comment_content;
771
+			$excerpt = strip_tags($comment_content);
772
+		}
773
+	}
774
+	return $excerpt;
775 775
 }
776 776
\ 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.
Indentation   +1804 added lines, -1804 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,87 +983,87 @@  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
-        $post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page.
1047
-        $slides = 0;
1048
-
1049
-        if (!empty($post_images)) {
1050
-            foreach ($post_images as $image) {
1051
-                if ($image->height >= 400) {
1052
-                    $spacer_height = 0;
1053
-                } else {
1054
-                    $spacer_height = ((400 - $image->height) / 2);
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>';
1060
-                $slides++;
1061
-            }
1062
-        }// endfore
1063
-    }
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
+		$post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page.
1047
+		$slides = 0;
1048
+
1049
+		if (!empty($post_images)) {
1050
+			foreach ($post_images as $image) {
1051
+				if ($image->height >= 400) {
1052
+					$spacer_height = 0;
1053
+				} else {
1054
+					$spacer_height = ((400 - $image->height) / 2);
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>';
1060
+				$slides++;
1061
+			}
1062
+		}// endfore
1063
+	}
1064 1064
 
1065
-    if (!empty($post_images)) {
1066
-        ?>
1065
+	if (!empty($post_images)) {
1066
+		?>
1067 1067
         <div class="geodir_flex-container">
1068 1068
             <div class="geodir_flex-loader"><i class="fa fa-refresh fa-spin"></i></div>
1069 1069
             <div id="geodir_slider" class="geodir_flexslider ">
@@ -1076,7 +1076,7 @@  discard block
 block discarded – undo
1076 1076
             <?php } ?>
1077 1077
         </div>
1078 1078
     <?php
1079
-    }
1079
+	}
1080 1080
 }
1081 1081
 
1082 1082
 add_action('geodir_details_taxonomies', 'geodir_action_details_taxonomies', 10);
@@ -1091,177 +1091,177 @@  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
-    $taxonomies = array();
1098
-
1099
-    $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
1100
-
1101
-    if ($preview && !$is_backend_preview) {
1102
-        $post_type = $post->listing_type;
1103
-        $post_taxonomy = $post_type . 'category';
1104
-        $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1105
-    } else {
1106
-        $post_type = $post->post_type;
1107
-        $post_taxonomy = $post_type . 'category';
1108
-    }
1097
+	$taxonomies = array();
1098
+
1099
+	$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
1100
+
1101
+	if ($preview && !$is_backend_preview) {
1102
+		$post_type = $post->listing_type;
1103
+		$post_taxonomy = $post_type . 'category';
1104
+		$post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1105
+	} else {
1106
+		$post_type = $post->post_type;
1107
+		$post_taxonomy = $post_type . 'category';
1108
+	}
1109 1109
 //{	
1110
-    $post_type_info = get_post_type_object($post_type);
1111
-    $listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1112
-
1113
-    if (!empty($post->post_tags)) {
1114
-
1115
-        if (taxonomy_exists($post_type . '_tags')):
1116
-            $links = array();
1117
-            $terms = array();
1118
-            // to limit post tags
1119
-            $post_tags = trim($post->post_tags, ",");
1120
-            $post_id = isset($post->ID) ? $post->ID : '';
1121
-            /**
1122
-             * Filter the post tags.
1123
-             *
1124
-             * Allows you to filter the post tags output on the details page of a post.
1125
-             *
1126
-             * @since 1.0.0
1127
-             * @param string $post_tags A comma seperated list of tags.
1128
-             * @param int $post_id The current post id.
1129
-             */
1130
-            $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1131
-
1132
-            $post->post_tags = $post_tags;
1133
-            $post_tags = explode(",", trim($post->post_tags, ","));
1134
-
1135
-
1136
-            foreach ($post_tags as $post_term) {
1137
-
1138
-                // fix slug creation order for tags & location
1139
-                $post_term = trim($post_term);
1140
-
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');
1144
-                } else {
1145
-                    $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1146
-                    $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1147
-                    $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1148
-                    $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1149
-                    $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1150
-                    $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1151
-                    if ($match_country || $match_region || $match_city) {
1152
-                        $priority_location = true;
1153
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1154
-                    } else {
1155
-                        $insert_term = wp_insert_term($post_term, $post_type . '_tags');
1156
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1157
-                    }
1158
-                }
1159
-
1160
-                if (!is_wp_error($term) && is_object($term)) {
1161
-
1162
-                    // fix tag link on detail page
1163
-                    if ($priority_location) {
1164
-
1165
-                        $tag_link = "<a href=''>$post_term</a>";
1166
-                        /**
1167
-                         * Filter the tag name on the details page.
1168
-                         *
1169
-                         * @since 1.5.6
1170
-                         * @param string $tag_link The tag link html.
1171
-                         * @param object $term The tag term object.
1172
-                         */
1173
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1174
-                        $links[] = $tag_link;
1175
-                    } else {
1176
-                        $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1177
-                        /** This action is documented in geodirectory-template_actions.php */
1178
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1179
-                        $links[] = $tag_link;
1180
-                    }
1181
-                    $terms[] = $term;
1182
-                }
1183
-                //
1184
-            }
1185
-            if (!isset($listing_label)) {
1186
-                $listing_label = '';
1187
-            }
1188
-            $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1189
-        endif;
1190
-
1191
-    }
1192
-
1193
-    if (!empty($post->{$post_taxonomy})) {
1194
-        $links = array();
1195
-        $terms = array();
1196
-        $termsOrdered = array();
1197
-        if (!is_array($post->{$post_taxonomy})) {
1198
-            $post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1199
-        } else {
1200
-            $post_term = $post->{$post_taxonomy};
1110
+	$post_type_info = get_post_type_object($post_type);
1111
+	$listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1112
+
1113
+	if (!empty($post->post_tags)) {
1114
+
1115
+		if (taxonomy_exists($post_type . '_tags')):
1116
+			$links = array();
1117
+			$terms = array();
1118
+			// to limit post tags
1119
+			$post_tags = trim($post->post_tags, ",");
1120
+			$post_id = isset($post->ID) ? $post->ID : '';
1121
+			/**
1122
+			 * Filter the post tags.
1123
+			 *
1124
+			 * Allows you to filter the post tags output on the details page of a post.
1125
+			 *
1126
+			 * @since 1.0.0
1127
+			 * @param string $post_tags A comma seperated list of tags.
1128
+			 * @param int $post_id The current post id.
1129
+			 */
1130
+			$post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1131
+
1132
+			$post->post_tags = $post_tags;
1133
+			$post_tags = explode(",", trim($post->post_tags, ","));
1134
+
1135
+
1136
+			foreach ($post_tags as $post_term) {
1137
+
1138
+				// fix slug creation order for tags & location
1139
+				$post_term = trim($post_term);
1140
+
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');
1144
+				} else {
1145
+					$post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1146
+					$post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1147
+					$post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1148
+					$match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1149
+					$match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1150
+					$match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1151
+					if ($match_country || $match_region || $match_city) {
1152
+						$priority_location = true;
1153
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1154
+					} else {
1155
+						$insert_term = wp_insert_term($post_term, $post_type . '_tags');
1156
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1157
+					}
1158
+				}
1159
+
1160
+				if (!is_wp_error($term) && is_object($term)) {
1161
+
1162
+					// fix tag link on detail page
1163
+					if ($priority_location) {
1164
+
1165
+						$tag_link = "<a href=''>$post_term</a>";
1166
+						/**
1167
+						 * Filter the tag name on the details page.
1168
+						 *
1169
+						 * @since 1.5.6
1170
+						 * @param string $tag_link The tag link html.
1171
+						 * @param object $term The tag term object.
1172
+						 */
1173
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1174
+						$links[] = $tag_link;
1175
+					} else {
1176
+						$tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1177
+						/** This action is documented in geodirectory-template_actions.php */
1178
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1179
+						$links[] = $tag_link;
1180
+					}
1181
+					$terms[] = $term;
1182
+				}
1183
+				//
1184
+			}
1185
+			if (!isset($listing_label)) {
1186
+				$listing_label = '';
1187
+			}
1188
+			$taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1189
+		endif;
1190
+
1191
+	}
1192
+
1193
+	if (!empty($post->{$post_taxonomy})) {
1194
+		$links = array();
1195
+		$terms = array();
1196
+		$termsOrdered = array();
1197
+		if (!is_array($post->{$post_taxonomy})) {
1198
+			$post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1199
+		} else {
1200
+			$post_term = $post->{$post_taxonomy};
1201 1201
 			
1202 1202
 			if ($preview && !$is_backend_preview) {
1203 1203
 				$post_term = geodir_add_parent_terms($post_term, $post_taxonomy);
1204 1204
 			}
1205
-        }
1206
-
1207
-        $post_term = array_unique($post_term);
1208
-        if (!empty($post_term)) {
1209
-            foreach ($post_term as $post_term) {
1210
-                $post_term = trim($post_term);
1211
-
1212
-                if ($post_term != ''):
1213
-                    $term = get_term_by('id', $post_term, $post_taxonomy);
1214
-
1215
-                    if (is_object($term)) {
1216
-                        $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1217
-                        /**
1218
-                         * Filter the category name on the details page.
1219
-                         *
1220
-                         * @since 1.5.6
1221
-                         * @param string $term_link The link html to the category.
1222
-                         * @param object $term The category term object.
1223
-                         */
1224
-                        $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1225
-                        $links[] = $term_link;
1226
-                        $terms[] = $term;
1227
-                    }
1228
-                endif;
1229
-            }
1230
-            // order alphabetically
1231
-            asort($links);
1232
-            foreach (array_keys($links) as $key) {
1233
-                $termsOrdered[$key] = $terms[$key];
1234
-            }
1235
-            $terms = $termsOrdered;
1205
+		}
1206
+
1207
+		$post_term = array_unique($post_term);
1208
+		if (!empty($post_term)) {
1209
+			foreach ($post_term as $post_term) {
1210
+				$post_term = trim($post_term);
1211
+
1212
+				if ($post_term != ''):
1213
+					$term = get_term_by('id', $post_term, $post_taxonomy);
1214
+
1215
+					if (is_object($term)) {
1216
+						$term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1217
+						/**
1218
+						 * Filter the category name on the details page.
1219
+						 *
1220
+						 * @since 1.5.6
1221
+						 * @param string $term_link The link html to the category.
1222
+						 * @param object $term The category term object.
1223
+						 */
1224
+						$term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1225
+						$links[] = $term_link;
1226
+						$terms[] = $term;
1227
+					}
1228
+				endif;
1229
+			}
1230
+			// order alphabetically
1231
+			asort($links);
1232
+			foreach (array_keys($links) as $key) {
1233
+				$termsOrdered[$key] = $terms[$key];
1234
+			}
1235
+			$terms = $termsOrdered;
1236 1236
 
1237
-        }
1237
+		}
1238 1238
 
1239
-        if (!isset($listing_label)) {
1240
-            $listing_label = '';
1241
-        }
1242
-        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1239
+		if (!isset($listing_label)) {
1240
+			$listing_label = '';
1241
+		}
1242
+		$taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1243 1243
 
1244
-    }
1244
+	}
1245 1245
 
1246
-    /**
1247
-     * Filter the taxonomies array before output.
1248
-     *
1249
-     * @since 1.5.9
1250
-     * @param array $taxonomies The array of cats and tags.
1251
-     * @param string $post_type The post type being output.
1252
-     * @param string $listing_label The post type label.
1253
-     * @param string $listing_label The post type label with ucwords function.
1254
-     */
1255
-    $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1246
+	/**
1247
+	 * Filter the taxonomies array before output.
1248
+	 *
1249
+	 * @since 1.5.9
1250
+	 * @param array $taxonomies The array of cats and tags.
1251
+	 * @param string $post_type The post type being output.
1252
+	 * @param string $listing_label The post type label.
1253
+	 * @param string $listing_label The post type label with ucwords function.
1254
+	 */
1255
+	$taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1256 1256
 
1257
-    if (isset($taxonomies[$post_taxonomy])) {
1258
-        echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1259
-    }
1257
+	if (isset($taxonomies[$post_taxonomy])) {
1258
+		echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
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
1266 1266
 }
1267 1267
 
@@ -1283,140 +1283,140 @@  discard block
 block discarded – undo
1283 1283
 function geodir_action_details_micordata($post='')
1284 1284
 {
1285 1285
 
1286
-    global $preview;
1287
-    if(empty($post)){global $post;}
1288
-    if ($preview || !geodir_is_page('detail')) {
1289
-        return;
1290
-    }
1291
-
1292
-    // url
1293
-    $c_url = geodir_curPageURL();
1294
-
1295
-    // post reviews
1296
-    $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1297
-    if (empty($post_reviews)) {
1298
-        $reviews = '';
1299
-    } else {
1300
-        foreach ($post_reviews as $review) {
1301
-            $reviews[] = array(
1302
-                "@type" => "Review",
1303
-                "author" => $review->comment_author,
1304
-                "datePublished" => $review->comment_date,
1305
-                "description" => $review->comment_content,
1306
-                "reviewRating" => array(
1307
-                    "@type" => "Rating",
1308
-                    "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1309
-                    "ratingValue" => geodir_get_commentoverall($review->comment_ID),
1310
-                    "worstRating" => "1"
1311
-                )
1312
-            );
1313
-        }
1314
-
1315
-    }
1316
-
1317
-    // post images
1318
-    $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1319
-    if (empty($post_images)) {
1320
-        $images = '';
1321
-    } else {
1322
-        $i_arr = array();
1323
-        foreach ($post_images as $img) {
1324
-            $i_arr[] = $img->src;
1325
-        }
1326
-
1327
-        if (count($i_arr) == 1) {
1328
-            $images = $i_arr[0];
1329
-        } else {
1330
-            $images = $i_arr;
1331
-        }
1332
-
1333
-    }
1334
-    //print_r($post);
1335
-    // external links
1336
-    $external_links =  array();
1337
-    $external_links[] = $post->geodir_website;
1338
-    $external_links[] = $post->geodir_twitter;
1339
-    $external_links[] = $post->geodir_facebook;
1340
-    $external_links = array_filter($external_links);
1341
-
1342
-    if(!empty($external_links)){
1343
-        $external_links = array_values($external_links);
1344
-    }
1345
-
1346
-    // reviews
1347
-    $comment_count = geodir_get_review_count_total($post->ID);
1348
-    $post_avgratings = geodir_get_post_rating($post->ID);
1349
-
1350
-    // schema type
1351
-    $schema_type = 'LocalBusiness';
1352
-    if(isset($post->default_category) && $post->default_category){
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';}
1356
-    }
1357
-
1358
-    $schema = array();
1359
-    $schema['@context'] = "https://schema.org";
1360
-    $schema['@type'] = $schema_type;
1361
-    $schema['name'] = $post->post_title;
1362
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1363
-    $schema['telephone'] = $post->geodir_contact;
1364
-    $schema['url'] = $c_url;
1365
-    $schema['sameAs'] = $external_links;
1366
-    $schema['image'] = $images;
1367
-    $schema['address'] = array(
1368
-        "@type" => "PostalAddress",
1369
-        "streetAddress" => $post->post_address,
1370
-        "addressLocality" => $post->post_city,
1371
-        "addressRegion" => $post->post_region,
1372
-        "addressCountry" => $post->post_country,
1373
-        "postalCode" => $post->post_zip
1374
-    );
1375
-
1376
-    if($post->post_latitude && $post->post_longitude) {
1377
-        $schema['geo'] = array(
1378
-            "@type" => "GeoCoordinates",
1379
-            "latitude" => $post->post_latitude,
1380
-            "longitude" => $post->post_longitude
1381
-        );
1382
-    }
1383
-
1384
-    if($post_avgratings) {
1385
-        $schema['aggregateRating'] = array(
1386
-            "@type" => "AggregateRating",
1387
-            "ratingValue" => $post_avgratings,
1388
-            "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1389
-            "worstRating" => "1",
1390
-            "ratingCount" => $comment_count
1391
-        );
1392
-    }
1393
-    $schema['review'] = $reviews;
1394
-
1395
-    /**
1396
-     * Allow the schema JSON-LD info to be filtered.
1397
-     *
1398
-     * @since 1.5.4
1399
-     * @since 1.5.7 Added $post variable.
1400
-     * @param array $schema The array of schema data to be filtered.
1401
-     * @param object $post The post object.
1402
-     */
1403
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1404
-
1405
-
1406
-    echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1407
-
1408
-
1409
-    $uploads = wp_upload_dir();
1410
-    $facebook_og = (isset($post->featured_image) && $post->featured_image) ? '<meta property="og:image" content="'.$uploads['baseurl'].$post->featured_image.'"/>' : '';
1411
-
1412
-    /**
1413
-     * Show facebook open graph meta info
1414
-     *
1415
-     * @since 1.6.6
1416
-     * @param string $facebook_og The open graph html to be filtered.
1417
-     * @param object $post The post object.
1418
-     */
1419
-    echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1286
+	global $preview;
1287
+	if(empty($post)){global $post;}
1288
+	if ($preview || !geodir_is_page('detail')) {
1289
+		return;
1290
+	}
1291
+
1292
+	// url
1293
+	$c_url = geodir_curPageURL();
1294
+
1295
+	// post reviews
1296
+	$post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1297
+	if (empty($post_reviews)) {
1298
+		$reviews = '';
1299
+	} else {
1300
+		foreach ($post_reviews as $review) {
1301
+			$reviews[] = array(
1302
+				"@type" => "Review",
1303
+				"author" => $review->comment_author,
1304
+				"datePublished" => $review->comment_date,
1305
+				"description" => $review->comment_content,
1306
+				"reviewRating" => array(
1307
+					"@type" => "Rating",
1308
+					"bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1309
+					"ratingValue" => geodir_get_commentoverall($review->comment_ID),
1310
+					"worstRating" => "1"
1311
+				)
1312
+			);
1313
+		}
1314
+
1315
+	}
1316
+
1317
+	// post images
1318
+	$post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1319
+	if (empty($post_images)) {
1320
+		$images = '';
1321
+	} else {
1322
+		$i_arr = array();
1323
+		foreach ($post_images as $img) {
1324
+			$i_arr[] = $img->src;
1325
+		}
1326
+
1327
+		if (count($i_arr) == 1) {
1328
+			$images = $i_arr[0];
1329
+		} else {
1330
+			$images = $i_arr;
1331
+		}
1332
+
1333
+	}
1334
+	//print_r($post);
1335
+	// external links
1336
+	$external_links =  array();
1337
+	$external_links[] = $post->geodir_website;
1338
+	$external_links[] = $post->geodir_twitter;
1339
+	$external_links[] = $post->geodir_facebook;
1340
+	$external_links = array_filter($external_links);
1341
+
1342
+	if(!empty($external_links)){
1343
+		$external_links = array_values($external_links);
1344
+	}
1345
+
1346
+	// reviews
1347
+	$comment_count = geodir_get_review_count_total($post->ID);
1348
+	$post_avgratings = geodir_get_post_rating($post->ID);
1349
+
1350
+	// schema type
1351
+	$schema_type = 'LocalBusiness';
1352
+	if(isset($post->default_category) && $post->default_category){
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';}
1356
+	}
1357
+
1358
+	$schema = array();
1359
+	$schema['@context'] = "https://schema.org";
1360
+	$schema['@type'] = $schema_type;
1361
+	$schema['name'] = $post->post_title;
1362
+	$schema['description'] = wp_strip_all_tags( $post->post_content, true );
1363
+	$schema['telephone'] = $post->geodir_contact;
1364
+	$schema['url'] = $c_url;
1365
+	$schema['sameAs'] = $external_links;
1366
+	$schema['image'] = $images;
1367
+	$schema['address'] = array(
1368
+		"@type" => "PostalAddress",
1369
+		"streetAddress" => $post->post_address,
1370
+		"addressLocality" => $post->post_city,
1371
+		"addressRegion" => $post->post_region,
1372
+		"addressCountry" => $post->post_country,
1373
+		"postalCode" => $post->post_zip
1374
+	);
1375
+
1376
+	if($post->post_latitude && $post->post_longitude) {
1377
+		$schema['geo'] = array(
1378
+			"@type" => "GeoCoordinates",
1379
+			"latitude" => $post->post_latitude,
1380
+			"longitude" => $post->post_longitude
1381
+		);
1382
+	}
1383
+
1384
+	if($post_avgratings) {
1385
+		$schema['aggregateRating'] = array(
1386
+			"@type" => "AggregateRating",
1387
+			"ratingValue" => $post_avgratings,
1388
+			"bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1389
+			"worstRating" => "1",
1390
+			"ratingCount" => $comment_count
1391
+		);
1392
+	}
1393
+	$schema['review'] = $reviews;
1394
+
1395
+	/**
1396
+	 * Allow the schema JSON-LD info to be filtered.
1397
+	 *
1398
+	 * @since 1.5.4
1399
+	 * @since 1.5.7 Added $post variable.
1400
+	 * @param array $schema The array of schema data to be filtered.
1401
+	 * @param object $post The post object.
1402
+	 */
1403
+	$schema = apply_filters('geodir_details_schema', $schema,$post);
1404
+
1405
+
1406
+	echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1407
+
1408
+
1409
+	$uploads = wp_upload_dir();
1410
+	$facebook_og = (isset($post->featured_image) && $post->featured_image) ? '<meta property="og:image" content="'.$uploads['baseurl'].$post->featured_image.'"/>' : '';
1411
+
1412
+	/**
1413
+	 * Show facebook open graph meta info
1414
+	 *
1415
+	 * @since 1.6.6
1416
+	 * @param string $facebook_og The open graph html to be filtered.
1417
+	 * @param object $post The post object.
1418
+	 */
1419
+	echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1420 1420
 
1421 1421
 
1422 1422
 
@@ -1436,7 +1436,7 @@  discard block
 block discarded – undo
1436 1436
  */
1437 1437
 function geodir_action_details_next_prev()
1438 1438
 {
1439
-    ?>
1439
+	?>
1440 1440
     <div class="geodir-pos_navigation clearfix">
1441 1441
     <div
1442 1442
         class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
@@ -1454,15 +1454,15 @@  discard block
 block discarded – undo
1454 1454
  */
1455 1455
 function geodir_action_before_single_post()
1456 1456
 {
1457
-    global $post;
1458
-    /**
1459
-     * Called at the very start of the details page output, before the title section.
1460
-     *
1461
-     * @since 1.0.0
1462
-     * @param object $post The current post object.
1463
-     * @global WP_Post|null $post The current post, if available.
1464
-     */
1465
-    do_action('geodir_before_single_post', $post); // extra action	
1457
+	global $post;
1458
+	/**
1459
+	 * Called at the very start of the details page output, before the title section.
1460
+	 *
1461
+	 * @since 1.0.0
1462
+	 * @param object $post The current post object.
1463
+	 * @global WP_Post|null $post The current post, if available.
1464
+	 */
1465
+	do_action('geodir_before_single_post', $post); // extra action	
1466 1466
 }
1467 1467
 
1468 1468
 /**
@@ -1473,13 +1473,13 @@  discard block
 block discarded – undo
1473 1473
  */
1474 1474
 function geodir_action_after_single_post($post)
1475 1475
 {
1476
-    /**
1477
-     * Called on the details page after the details page tabs section and before the next/prev buttons.
1478
-     *
1479
-     * @since 1.0.0
1480
-     * @param object $post The current post object.
1481
-     */
1482
-    do_action('geodir_after_single_post', $post); // extra action	
1476
+	/**
1477
+	 * Called on the details page after the details page tabs section and before the next/prev buttons.
1478
+	 *
1479
+	 * @since 1.0.0
1480
+	 * @param object $post The current post object.
1481
+	 */
1482
+	do_action('geodir_after_single_post', $post); // extra action	
1483 1483
 }
1484 1484
 
1485 1485
 add_action('geodir_details_main_content', 'geodir_action_before_single_post', 10);
@@ -1505,168 +1505,168 @@  discard block
 block discarded – undo
1505 1505
  */
1506 1506
 function geodir_action_listings_title()
1507 1507
 {
1508
-    global $wp, $term;
1508
+	global $wp, $term;
1509 1509
 
1510
-    $gd_post_type = geodir_get_current_posttype();
1511
-    $post_type_info = get_post_type_object($gd_post_type);
1510
+	$gd_post_type = geodir_get_current_posttype();
1511
+	$post_type_info = get_post_type_object($gd_post_type);
1512 1512
 
1513
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
1514
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1515
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1516
-    }
1513
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
1514
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1515
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1516
+	}
1517 1517
 
1518
-    $list_title = $add_string_in_title . __($post_type_info->labels->name, 'geodirectory');
1519
-    $single_name = $post_type_info->labels->singular_name;
1518
+	$list_title = $add_string_in_title . __($post_type_info->labels->name, 'geodirectory');
1519
+	$single_name = $post_type_info->labels->singular_name;
1520 1520
 
1521
-    $taxonomy = geodir_get_taxonomies($gd_post_type, true);
1521
+	$taxonomy = geodir_get_taxonomies($gd_post_type, true);
1522 1522
 
1523
-    $gd_country = get_query_var('gd_country');
1524
-    $gd_region = get_query_var('gd_region');
1525
-    $gd_city = get_query_var('gd_city');
1523
+	$gd_country = get_query_var('gd_country');
1524
+	$gd_region = get_query_var('gd_region');
1525
+	$gd_city = get_query_var('gd_city');
1526 1526
 
1527
-    if (!empty($term)) {
1528
-        $location_name = '';
1529
-        if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1530
-            if ($gd_country != '') {
1531
-                $location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1532
-            }
1533
-
1534
-            if ($gd_region != '') {
1535
-                $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1536
-            }
1537
-
1538
-            if ($gd_city != '') {
1539
-                $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1540
-            }
1541
-        }
1542
-
1543
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
1544
-        if (!empty($current_term)) {
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') {
1547
-                $location_last_char = substr($location_name, -1);
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;
1550
-            } else {
1551
-                $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1552
-            }
1553
-        } else {
1554
-            if (count($taxonomy) > 1) {
1555
-                $current_term = get_term_by('slug', $term, $taxonomy[1]);
1556
-
1557
-                if (!empty($current_term)) {
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') {
1560
-                        $location_last_char = substr($location_name, -1);
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;
1563
-                    } else {
1564
-                        $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1565
-                    }
1566
-                }
1567
-            }
1568
-        }
1569
-
1570
-    } else {
1571
-        $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1572
-        $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1573
-        $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1574
-
1575
-        $gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1576
-
1577
-        if (function_exists('get_actual_location_name')) {
1578
-            $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1579
-            $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1580
-            $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1581
-        }
1582
-
1583
-        if ($gd_city != '') {
1584
-            if ($gd_city_actual != '') {
1585
-                $gd_city = $gd_city_actual;
1586
-            } else {
1587
-                $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1588
-                $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1589
-                $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1590
-            }
1591
-
1592
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1593
-        } else if ($gd_region != '') {
1594
-            if ($gd_region_actual != '') {
1595
-                $gd_region = $gd_region_actual;
1596
-            } else {
1597
-                $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1598
-                $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1599
-                $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1600
-            }
1601
-
1602
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1603
-        } else if ($gd_country != '') {
1604
-            if ($gd_country_actual != '') {
1605
-                $gd_country = $gd_country_actual;
1606
-            } else {
1607
-                $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1608
-                $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1609
-                $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1610
-            }
1611
-
1612
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1613
-        }
1614
-    }
1615
-
1616
-    if (is_search()) {
1617
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1618
-    }
1619
-    /** This action is documented in geodirectory_template_actions.php */
1620
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
1621
-    /** This action is documented in geodirectory_template_actions.php */
1622
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1623
-
1624
-
1625
-    $title = $list_title;
1626
-    $gd_page = '';
1627
-    if(geodir_is_page('pt')){
1628
-        $gd_page = 'pt';
1629
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1630
-    }
1631
-    elseif(geodir_is_page('listing')){
1632
-        $gd_page = 'listing';
1633
-        global $wp_query;
1634
-        $current_term = $wp_query->get_queried_object();
1635
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1636
-            $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1637
-        }else{
1638
-            $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1639
-        }
1527
+	if (!empty($term)) {
1528
+		$location_name = '';
1529
+		if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1530
+			if ($gd_country != '') {
1531
+				$location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1532
+			}
1640 1533
 
1641
-    }
1642
-    elseif(geodir_is_page('author')){
1643
-        $gd_page = 'author';
1644
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1645
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1646
-        }else{
1647
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1648
-        }
1534
+			if ($gd_region != '') {
1535
+				$location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1536
+			}
1649 1537
 
1650
-    }
1538
+			if ($gd_city != '') {
1539
+				$location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1540
+			}
1541
+		}
1542
+
1543
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
1544
+		if (!empty($current_term)) {
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') {
1547
+				$location_last_char = substr($location_name, -1);
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;
1550
+			} else {
1551
+				$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1552
+			}
1553
+		} else {
1554
+			if (count($taxonomy) > 1) {
1555
+				$current_term = get_term_by('slug', $term, $taxonomy[1]);
1556
+
1557
+				if (!empty($current_term)) {
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') {
1560
+						$location_last_char = substr($location_name, -1);
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;
1563
+					} else {
1564
+						$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1565
+					}
1566
+				}
1567
+			}
1568
+		}
1569
+
1570
+	} else {
1571
+		$gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1572
+		$gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1573
+		$gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1574
+
1575
+		$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1576
+
1577
+		if (function_exists('get_actual_location_name')) {
1578
+			$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1579
+			$gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1580
+			$gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1581
+		}
1582
+
1583
+		if ($gd_city != '') {
1584
+			if ($gd_city_actual != '') {
1585
+				$gd_city = $gd_city_actual;
1586
+			} else {
1587
+				$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1588
+				$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1589
+				$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1590
+			}
1651 1591
 
1592
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1593
+		} else if ($gd_region != '') {
1594
+			if ($gd_region_actual != '') {
1595
+				$gd_region = $gd_region_actual;
1596
+			} else {
1597
+				$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1598
+				$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1599
+				$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1600
+			}
1652 1601
 
1653
-    /**
1654
-     * Filter page title to replace variables.
1655
-     *
1656
-     * @since 1.5.4
1657
-     * @param string $title The page title including variables.
1658
-     * @param string $gd_page The GeoDirectory page type if any.
1659
-     */
1660
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1602
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1603
+		} else if ($gd_country != '') {
1604
+			if ($gd_country_actual != '') {
1605
+				$gd_country = $gd_country_actual;
1606
+			} else {
1607
+				$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1608
+				$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1609
+				$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1610
+			}
1661 1611
 
1662
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1663
-        /**
1664
-         * Filter the listing page title.
1665
-         *
1666
-         * @since 1.0.0
1667
-         * @param string $list_title The title for the category page.
1668
-         */
1669
-        apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1612
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1613
+		}
1614
+	}
1615
+
1616
+	if (is_search()) {
1617
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1618
+	}
1619
+	/** This action is documented in geodirectory_template_actions.php */
1620
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
1621
+	/** This action is documented in geodirectory_template_actions.php */
1622
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1623
+
1624
+
1625
+	$title = $list_title;
1626
+	$gd_page = '';
1627
+	if(geodir_is_page('pt')){
1628
+		$gd_page = 'pt';
1629
+		$title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1630
+	}
1631
+	elseif(geodir_is_page('listing')){
1632
+		$gd_page = 'listing';
1633
+		global $wp_query;
1634
+		$current_term = $wp_query->get_queried_object();
1635
+		if (strpos($current_term->taxonomy,'_tags') !== false) {
1636
+			$title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1637
+		}else{
1638
+			$title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1639
+		}
1640
+
1641
+	}
1642
+	elseif(geodir_is_page('author')){
1643
+		$gd_page = 'author';
1644
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1645
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1646
+		}else{
1647
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1648
+		}
1649
+
1650
+	}
1651
+
1652
+
1653
+	/**
1654
+	 * Filter page title to replace variables.
1655
+	 *
1656
+	 * @since 1.5.4
1657
+	 * @param string $title The page title including variables.
1658
+	 * @param string $gd_page The GeoDirectory page type if any.
1659
+	 */
1660
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1661
+
1662
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1663
+		/**
1664
+		 * Filter the listing page title.
1665
+		 *
1666
+		 * @since 1.0.0
1667
+		 * @param string $list_title The title for the category page.
1668
+		 */
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);
@@ -1679,46 +1679,46 @@  discard block
 block discarded – undo
1679 1679
  */
1680 1680
 function geodir_action_listings_description()
1681 1681
 {
1682
-    global $wp_query;
1683
-    $current_term = $wp_query->get_queried_object();
1682
+	global $wp_query;
1683
+	$current_term = $wp_query->get_queried_object();
1684 1684
 
1685
-    $gd_post_type = geodir_get_current_posttype();
1686
-    if (isset($current_term->term_id) && $current_term->term_id != '') {
1685
+	$gd_post_type = geodir_get_current_posttype();
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');
1689
-        $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1690
-        if ($term_desc && !$saved_data) {
1691
-            $saved_data = $term_desc;
1692
-        }
1688
+		$term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1689
+		$saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1690
+		if ($term_desc && !$saved_data) {
1691
+			$saved_data = $term_desc;
1692
+		}
1693 1693
 
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 );
1698
-        }
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 );
1698
+		}
1699 1699
 
1700
-        /**
1701
-         * Apply the core filter `the_content` filter to the variable string.
1702
-         *
1703
-         * This is a WordPress core filter that does many things.
1704
-         *
1705
-         * @since 1.0.0
1706
-         * @param string $var The string to apply the filter to.
1707
-         */
1708
-        $cat_description = apply_filters('the_content', $saved_data);
1700
+		/**
1701
+		 * Apply the core filter `the_content` filter to the variable string.
1702
+		 *
1703
+		 * This is a WordPress core filter that does many things.
1704
+		 *
1705
+		 * @since 1.0.0
1706
+		 * @param string $var The string to apply the filter to.
1707
+		 */
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 );
1713
-        }
1711
+		if ( false !== $filter_priority ) {
1712
+			add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1713
+		}
1714 1714
 
1715
-        if ($cat_description) {
1716
-            ?>
1715
+		if ($cat_description) {
1716
+			?>
1717 1717
 
1718 1718
             <div class="term_description"><?php echo $cat_description;?></div> <?php
1719
-        }
1719
+		}
1720 1720
 
1721
-    }
1721
+	}
1722 1722
 }
1723 1723
 
1724 1724
 // action for adding the listings page top widget area
@@ -1737,11 +1737,11 @@  discard block
 block discarded – undo
1737 1737
  */
1738 1738
 function geodir_action_geodir_sidebar_listings_top()
1739 1739
 {
1740
-    if (get_option('geodir_show_listing_top_section')) { ?>
1740
+	if (get_option('geodir_show_listing_top_section')) { ?>
1741 1741
         <div
1742 1742
             class="<?php
1743
-            /** This action is documented in geodirectory_template_actions.php */
1744
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1743
+			/** This action is documented in geodirectory_template_actions.php */
1744
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1745 1745
             <?php dynamic_sidebar('geodir_listing_top'); ?>
1746 1746
         </div><!-- clearfix ends here-->
1747 1747
     <?php }
@@ -1764,35 +1764,35 @@  discard block
 block discarded – undo
1764 1764
  */
1765 1765
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1766 1766
 {
1767
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1768
-        $width_css = 'style="width:' . $width . '%;"';
1769
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1770
-        $width_css = 'style="width:' . $width . '%;"';
1771
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1772
-        $width_css = 'style="width:' . $width . '%;"';
1773
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1774
-        $width_css = 'style="width:' . $width . '%;"';
1775
-    } else {
1776
-        $width_css = '';
1777
-    }
1778
-
1779
-    $tc = get_option('theme_compatibility_setting');
1780
-    if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1781
-        $text = $tc['geodir_sidebar_left_open_replace'];
1782
-    } else {
1783
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1784
-    }
1785
-
1786
-    if (!empty($tc['geodir_sidebar_left_open_id'])) {
1787
-        $id = $tc['geodir_sidebar_left_open_id'];
1788
-    }
1789
-    if (!empty($tc['geodir_sidebar_left_open_class'])) {
1790
-        $class = $tc['geodir_sidebar_left_open_class'];
1791
-    }
1792
-
1793
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1794
-
1795
-    echo $text;
1767
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1768
+		$width_css = 'style="width:' . $width . '%;"';
1769
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1770
+		$width_css = 'style="width:' . $width . '%;"';
1771
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1772
+		$width_css = 'style="width:' . $width . '%;"';
1773
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1774
+		$width_css = 'style="width:' . $width . '%;"';
1775
+	} else {
1776
+		$width_css = '';
1777
+	}
1778
+
1779
+	$tc = get_option('theme_compatibility_setting');
1780
+	if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1781
+		$text = $tc['geodir_sidebar_left_open_replace'];
1782
+	} else {
1783
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1784
+	}
1785
+
1786
+	if (!empty($tc['geodir_sidebar_left_open_id'])) {
1787
+		$id = $tc['geodir_sidebar_left_open_id'];
1788
+	}
1789
+	if (!empty($tc['geodir_sidebar_left_open_class'])) {
1790
+		$class = $tc['geodir_sidebar_left_open_class'];
1791
+	}
1792
+
1793
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1794
+
1795
+	echo $text;
1796 1796
 }
1797 1797
 
1798 1798
 // action for adding the primary div closing tag
@@ -1808,13 +1808,13 @@  discard block
 block discarded – undo
1808 1808
  */
1809 1809
 function geodir_action_sidebar_left_close($type = '')
1810 1810
 {
1811
-    $tc = get_option('theme_compatibility_setting');
1812
-    if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1813
-        $text = $tc['geodir_sidebar_left_close_replace'];
1814
-    } else {
1815
-        $text = '</aside><!-- sidebar ends here-->';
1816
-    }
1817
-    echo $text;
1811
+	$tc = get_option('theme_compatibility_setting');
1812
+	if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1813
+		$text = $tc['geodir_sidebar_left_close_replace'];
1814
+	} else {
1815
+		$text = '</aside><!-- sidebar ends here-->';
1816
+	}
1817
+	echo $text;
1818 1818
 }
1819 1819
 
1820 1820
 /**
@@ -1827,7 +1827,7 @@  discard block
 block discarded – undo
1827 1827
  */
1828 1828
 function geodir_listing_left_section()
1829 1829
 {
1830
-    if (get_option('geodir_show_listing_left_section')) { ?>
1830
+	if (get_option('geodir_show_listing_left_section')) { ?>
1831 1831
         <div class="geodir-content-left geodir-sidebar-wrap">
1832 1832
             <?php dynamic_sidebar('geodir_listing_left_sidebar'); ?>
1833 1833
         </div><!-- end geodir-content-left -->
@@ -1845,20 +1845,20 @@  discard block
 block discarded – undo
1845 1845
  */
1846 1846
 function geodir_action_listings_sidebar_left()
1847 1847
 {
1848
-    if (get_option('geodir_show_listing_left_section')) {
1849
-        /** This action is documented in geodirectory_template_actions.php */
1850
-        do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'https://schema.org/WPSideBar');
1851
-        /**
1852
-         * Calls the listings page (category) left sidebar content.
1853
-         *
1854
-         * All the content for the listings page left sidebar is added via this hook.
1855
-         *
1856
-         * @since 1.0.0
1857
-         */
1858
-        do_action('geodir_listings_sidebar_left_inside');
1859
-        /** This action is documented in geodirectory_template_actions.php */
1860
-        do_action('geodir_sidebar_left_close', 'listings-page');
1861
-    }
1848
+	if (get_option('geodir_show_listing_left_section')) {
1849
+		/** This action is documented in geodirectory_template_actions.php */
1850
+		do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'https://schema.org/WPSideBar');
1851
+		/**
1852
+		 * Calls the listings page (category) left sidebar content.
1853
+		 *
1854
+		 * All the content for the listings page left sidebar is added via this hook.
1855
+		 *
1856
+		 * @since 1.0.0
1857
+		 */
1858
+		do_action('geodir_listings_sidebar_left_inside');
1859
+		/** This action is documented in geodirectory_template_actions.php */
1860
+		do_action('geodir_sidebar_left_close', 'listings-page');
1861
+	}
1862 1862
 }
1863 1863
 
1864 1864
 /**
@@ -1871,7 +1871,7 @@  discard block
 block discarded – undo
1871 1871
  */
1872 1872
 function geodir_listing_right_section()
1873 1873
 {
1874
-    if (get_option('geodir_show_listing_right_section')) { ?>
1874
+	if (get_option('geodir_show_listing_right_section')) { ?>
1875 1875
         <div class="geodir-content-right geodir-sidebar-wrap">
1876 1876
             <?php dynamic_sidebar('geodir_listing_right_sidebar'); ?>
1877 1877
         </div><!-- end geodir-content-right -->
@@ -1889,20 +1889,20 @@  discard block
 block discarded – undo
1889 1889
  */
1890 1890
 function geodir_action_listings_sidebar_right()
1891 1891
 {
1892
-    if (get_option('geodir_show_listing_right_section')) {
1893
-        /** This action is documented in geodirectory_template_actions.php */
1894
-        do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1895
-        /**
1896
-         * Calls the listings page (category) right sidebar content.
1897
-         *
1898
-         * All the content for the listings page right sidebar is added via this hook.
1899
-         *
1900
-         * @since 1.0.0
1901
-         */
1902
-        do_action('geodir_listings_sidebar_right_inside');
1903
-        /** This action is documented in geodirectory_template_actions.php */
1904
-        do_action('geodir_sidebar_right_close', 'listings-page');
1905
-    }
1892
+	if (get_option('geodir_show_listing_right_section')) {
1893
+		/** This action is documented in geodirectory_template_actions.php */
1894
+		do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1895
+		/**
1896
+		 * Calls the listings page (category) right sidebar content.
1897
+		 *
1898
+		 * All the content for the listings page right sidebar is added via this hook.
1899
+		 *
1900
+		 * @since 1.0.0
1901
+		 */
1902
+		do_action('geodir_listings_sidebar_right_inside');
1903
+		/** This action is documented in geodirectory_template_actions.php */
1904
+		do_action('geodir_sidebar_right_close', 'listings-page');
1905
+	}
1906 1906
 }
1907 1907
 
1908 1908
 
@@ -1919,23 +1919,23 @@  discard block
 block discarded – undo
1919 1919
  */
1920 1920
 function geodir_action_main_content_open($type = '', $id = '', $class = '')
1921 1921
 {
1922
-    $tc = get_option('theme_compatibility_setting');
1923
-    if (!empty($tc['geodir_main_content_open_replace'])) {
1924
-        $text = $tc['geodir_main_content_open_replace'];
1925
-    } else {
1926
-        $text = '<main id="[id]" class="[class]" role="main">';
1927
-    }
1922
+	$tc = get_option('theme_compatibility_setting');
1923
+	if (!empty($tc['geodir_main_content_open_replace'])) {
1924
+		$text = $tc['geodir_main_content_open_replace'];
1925
+	} else {
1926
+		$text = '<main id="[id]" class="[class]" role="main">';
1927
+	}
1928 1928
 
1929
-    if (!empty($tc['geodir_main_content_open_id'])) {
1930
-        $id = $tc['geodir_main_content_open_id'];
1931
-    }
1932
-    if (!empty($tc['geodir_main_content_open_class'])) {
1933
-        $class = $tc['geodir_main_content_open_class'];
1934
-    }
1929
+	if (!empty($tc['geodir_main_content_open_id'])) {
1930
+		$id = $tc['geodir_main_content_open_id'];
1931
+	}
1932
+	if (!empty($tc['geodir_main_content_open_class'])) {
1933
+		$class = $tc['geodir_main_content_open_class'];
1934
+	}
1935 1935
 
1936
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1936
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1937 1937
 
1938
-    echo $text;
1938
+	echo $text;
1939 1939
 }
1940 1940
 
1941 1941
 // action for adding the primary div closing tag
@@ -1948,13 +1948,13 @@  discard block
 block discarded – undo
1948 1948
  */
1949 1949
 function geodir_action_main_content_close()
1950 1950
 {
1951
-    $tc = get_option('theme_compatibility_setting');
1952
-    if (!empty($tc['geodir_main_content_close_replace'])) {
1953
-        $text = $tc['geodir_main_content_close_replace'];
1954
-    } else {
1955
-        $text = '</main><!-- main ends here-->';
1956
-    }
1957
-    echo $text;
1951
+	$tc = get_option('theme_compatibility_setting');
1952
+	if (!empty($tc['geodir_main_content_close_replace'])) {
1953
+		$text = $tc['geodir_main_content_close_replace'];
1954
+	} else {
1955
+		$text = '</main><!-- main ends here-->';
1956
+	}
1957
+	echo $text;
1958 1958
 }
1959 1959
 
1960 1960
 /**
@@ -1966,14 +1966,14 @@  discard block
 block discarded – undo
1966 1966
  */
1967 1967
 function geodir_action_listings_content_inside()
1968 1968
 {
1969
-    global $gridview_columns;
1970
-    $listing_view = get_option('geodir_listing_view');
1971
-    if (strstr($listing_view, 'gridview')) {
1972
-        $gridview_columns = $listing_view;
1973
-        $listing_view_exp = explode('_', $listing_view);
1974
-        $listing_view = $listing_view_exp[0];
1975
-    }
1976
-    geodir_get_template_part('listing', 'listview');
1969
+	global $gridview_columns;
1970
+	$listing_view = get_option('geodir_listing_view');
1971
+	if (strstr($listing_view, 'gridview')) {
1972
+		$gridview_columns = $listing_view;
1973
+		$listing_view_exp = explode('_', $listing_view);
1974
+		$listing_view = $listing_view_exp[0];
1975
+	}
1976
+	geodir_get_template_part('listing', 'listview');
1977 1977
 }
1978 1978
 
1979 1979
 add_action('geodir_listings_content_inside', 'geodir_action_listings_content_inside', 10);
@@ -1989,47 +1989,47 @@  discard block
 block discarded – undo
1989 1989
  */
1990 1990
 function geodir_action_listings_content()
1991 1991
 {
1992
-    /**
1993
-     * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
1994
-     *
1995
-     * @since 1.0.0
1996
-     * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1997
-     * @param string $id The id for the div. Usually 'geodir-main-content'.
1998
-     * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1999
-     * @see 'geodir_main_content_close' Where the oposing closing tag is added.
2000
-     */
2001
-    do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
2002
-    $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
2003
-    echo '<div class="clearfix '.$extra_class.'">';
2004
-    /**
2005
-     * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
2006
-     *
2007
-     * @since 1.0.0
2008
-     */
2009
-    do_action('geodir_before_listing');
2010
-    echo '</div>';
2011
-
2012
-    /**
2013
-     * This actions calls the listings list content. Used on listings pages and search and author pages.
2014
-     *
2015
-     * @since 1.0.0
2016
-     */
2017
-    do_action('geodir_listings_content_inside');
2018
-
2019
-    /**
2020
-     * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2021
-     *
2022
-     * @since 1.0.0
2023
-     */
2024
-    do_action('geodir_after_listing');
2025
-
2026
-    /**
2027
-     * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2028
-     *
2029
-     * @since 1.0.0
2030
-     * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2031
-     */
2032
-    do_action('geodir_main_content_close', 'listings-page');
1992
+	/**
1993
+	 * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
1994
+	 *
1995
+	 * @since 1.0.0
1996
+	 * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1997
+	 * @param string $id The id for the div. Usually 'geodir-main-content'.
1998
+	 * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1999
+	 * @see 'geodir_main_content_close' Where the oposing closing tag is added.
2000
+	 */
2001
+	do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
2002
+	$extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
2003
+	echo '<div class="clearfix '.$extra_class.'">';
2004
+	/**
2005
+	 * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
2006
+	 *
2007
+	 * @since 1.0.0
2008
+	 */
2009
+	do_action('geodir_before_listing');
2010
+	echo '</div>';
2011
+
2012
+	/**
2013
+	 * This actions calls the listings list content. Used on listings pages and search and author pages.
2014
+	 *
2015
+	 * @since 1.0.0
2016
+	 */
2017
+	do_action('geodir_listings_content_inside');
2018
+
2019
+	/**
2020
+	 * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2021
+	 *
2022
+	 * @since 1.0.0
2023
+	 */
2024
+	do_action('geodir_after_listing');
2025
+
2026
+	/**
2027
+	 * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2028
+	 *
2029
+	 * @since 1.0.0
2030
+	 * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2031
+	 */
2032
+	do_action('geodir_main_content_close', 'listings-page');
2033 2033
 }
2034 2034
 
2035 2035
 
@@ -2044,10 +2044,10 @@  discard block
 block discarded – undo
2044 2044
  */
2045 2045
 function geodir_action_sidebar_listings_bottom_section()
2046 2046
 {
2047
-    if (get_option('geodir_show_listing_bottom_section')) { ?>
2047
+	if (get_option('geodir_show_listing_bottom_section')) { ?>
2048 2048
         <div class="<?php
2049
-            /** This action is documented in geodirectory_template_actions.php */
2050
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2049
+			/** This action is documented in geodirectory_template_actions.php */
2050
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2051 2051
             <?php dynamic_sidebar('geodir_listing_bottom'); ?>
2052 2052
         </div><!-- clearfix ends here-->
2053 2053
     <?php }
@@ -2067,38 +2067,38 @@  discard block
 block discarded – undo
2067 2067
  */
2068 2068
 function geodir_action_add_listing_page_title()
2069 2069
 {
2070
-    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2071
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2072
-    /** This action is documented in geodirectory_template_actions.php */
2073
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2074
-    /** This action is documented in geodirectory_template_actions.php */
2075
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2076
-
2077
-    $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2078
-
2079
-    if(geodir_is_page('add-listing')){
2080
-        $gd_page = 'add-listing';
2081
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2082
-            $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2083
-        }elseif(isset($listing_type)){
2084
-            $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2085
-        }
2070
+	if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2071
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2072
+	/** This action is documented in geodirectory_template_actions.php */
2073
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2074
+	/** This action is documented in geodirectory_template_actions.php */
2075
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2076
+
2077
+	$title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2078
+
2079
+	if(geodir_is_page('add-listing')){
2080
+		$gd_page = 'add-listing';
2081
+		if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2082
+			$title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2083
+		}elseif(isset($listing_type)){
2084
+			$title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2085
+		}
2086 2086
 
2087
-    }
2087
+	}
2088 2088
 
2089 2089
 
2090
-    /**
2091
-     * Filter page title to replace variables.
2092
-     *
2093
-     * @since 1.5.4
2094
-     * @param string $title The page title including variables.
2095
-     * @param string $gd_page The GeoDirectory page type if any.
2096
-     */
2097
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2090
+	/**
2091
+	 * Filter page title to replace variables.
2092
+	 *
2093
+	 * @since 1.5.4
2094
+	 * @param string $title The page title including variables.
2095
+	 * @param string $gd_page The GeoDirectory page type if any.
2096
+	 */
2097
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2098 2098
 
2099
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2100
-    echo $title;
2101
-    echo '</h1></header>';
2099
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2100
+	echo $title;
2101
+	echo '</h1></header>';
2102 2102
 }
2103 2103
 
2104 2104
 add_action('geodir_add_listing_page_mandatory', 'geodir_action_add_listing_page_mandatory', 10);
@@ -2129,61 +2129,61 @@  discard block
 block discarded – undo
2129 2129
  */
2130 2130
 function geodir_action_add_listing_form()
2131 2131
 {
2132
-    global $cat_display, $post_cat, $current_user, $gd_session;
2133
-    $page_id = get_the_ID();
2134
-    $post = '';
2135
-    $title = '';
2136
-    $desc = '';
2137
-    $kw_tags = '';
2138
-    $required_msg = '';
2139
-    $submit_button = '';
2140
-
2141
-    $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2142
-
2143
-    $thumb_img_arr = array();
2144
-    $curImages = '';
2145
-
2146
-    if (isset($_REQUEST['backandedit'])) {
2147
-        global $post;
2148
-        $post = (object)$gd_session->get('listing');
2149
-        $listing_type = $post->listing_type;
2150
-        $title = $post->post_title;
2151
-        $desc = $post->post_desc;
2152
-        $post_cat = $post->post_category;
2153
-
2154
-        $kw_tags = $post->post_tags;
2155
-        $curImages = isset($post->post_images) ? $post->post_images : '';
2156
-    } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2157
-        global $post, $post_images;
2158
-
2159
-        $post = geodir_get_post_info($_REQUEST['pid']);
2160
-        $thumb_img_arr = geodir_get_images($post->ID);
2161
-        if ($thumb_img_arr) {
2162
-            foreach ($thumb_img_arr as $post_img) {
2163
-                $curImages .= $post_img->src . ',';
2164
-            }
2165
-        }
2132
+	global $cat_display, $post_cat, $current_user, $gd_session;
2133
+	$page_id = get_the_ID();
2134
+	$post = '';
2135
+	$title = '';
2136
+	$desc = '';
2137
+	$kw_tags = '';
2138
+	$required_msg = '';
2139
+	$submit_button = '';
2140
+
2141
+	$ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2142
+
2143
+	$thumb_img_arr = array();
2144
+	$curImages = '';
2145
+
2146
+	if (isset($_REQUEST['backandedit'])) {
2147
+		global $post;
2148
+		$post = (object)$gd_session->get('listing');
2149
+		$listing_type = $post->listing_type;
2150
+		$title = $post->post_title;
2151
+		$desc = $post->post_desc;
2152
+		$post_cat = $post->post_category;
2153
+
2154
+		$kw_tags = $post->post_tags;
2155
+		$curImages = isset($post->post_images) ? $post->post_images : '';
2156
+	} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2157
+		global $post, $post_images;
2158
+
2159
+		$post = geodir_get_post_info($_REQUEST['pid']);
2160
+		$thumb_img_arr = geodir_get_images($post->ID);
2161
+		if ($thumb_img_arr) {
2162
+			foreach ($thumb_img_arr as $post_img) {
2163
+				$curImages .= $post_img->src . ',';
2164
+			}
2165
+		}
2166 2166
 
2167
-        $listing_type = $post->post_type;
2168
-        $title = $post->post_title;
2169
-        $desc = $post->post_content;
2170
-        $kw_tags = $post->post_tags;
2171
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2172
-    } else {
2173
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2174
-    }
2167
+		$listing_type = $post->post_type;
2168
+		$title = $post->post_title;
2169
+		$desc = $post->post_content;
2170
+		$kw_tags = $post->post_tags;
2171
+		$kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2172
+	} else {
2173
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2174
+	}
2175 2175
 
2176
-    if ($current_user->ID != '0') {
2177
-        $user_login = true;
2178
-    }
2176
+	if ($current_user->ID != '0') {
2177
+		$user_login = true;
2178
+	}
2179 2179
 
2180
-    $post_type_info = geodir_get_posttype_info($listing_type);
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
-    $package_info = array();
2185
-    $package_info = geodir_post_package_info($package_info, $post);
2186
-    ?>
2184
+	$package_info = array();
2185
+	$package_info = geodir_post_package_info($package_info, $post);
2186
+	?>
2187 2187
     <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2188 2188
         <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2189 2189
         <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
@@ -2194,114 +2194,114 @@  discard block
 block discarded – undo
2194 2194
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2195 2195
             <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2196 2196
         <?php
2197
-        } 
2198
-        /**
2199
-         * Called at the very top of the add listing page form for frontend.
2200
-         *
2201
-         * This is called just before the "Enter Listing Details" text.
2202
-         *
2203
-         * @since 1.0.0
2204
-         */
2205
-        do_action('geodir_before_detail_fields');
2206
-        ?>
2197
+		} 
2198
+		/**
2199
+		 * Called at the very top of the add listing page form for frontend.
2200
+		 *
2201
+		 * This is called just before the "Enter Listing Details" text.
2202
+		 *
2203
+		 * @since 1.0.0
2204
+		 */
2205
+		do_action('geodir_before_detail_fields');
2206
+		?>
2207 2207
         <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2208 2208
         <?php
2209
-        /**
2210
-         * Called at the top of the add listing page form for frontend.
2211
-         *
2212
-         * This is called after the "Enter Listing Details" text.
2213
-         *
2214
-         * @since 1.0.0
2215
-         */
2216
-        do_action('geodir_before_main_form_fields');
2217
-        ?>
2209
+		/**
2210
+		 * Called at the top of the add listing page form for frontend.
2211
+		 *
2212
+		 * This is called after the "Enter Listing Details" text.
2213
+		 *
2214
+		 * @since 1.0.0
2215
+		 */
2216
+		do_action('geodir_before_main_form_fields');
2217
+		?>
2218 2218
         <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details">
2219 2219
             <label><?php
2220
-                /**
2221
-                 * Filter the add listing page title input label.
2222
-                 *
2223
-                 * @since 1.6.11
2224
-                 * @param string $title The title to be output.
2225
-                 * @param string $cpt_singular_name The singular title of the curent CPT.
2226
-                 * @param string $listing_type The CPT being requested. ie: gd_place.
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>
2220
+				/**
2221
+				 * Filter the add listing page title input label.
2222
+				 *
2223
+				 * @since 1.6.11
2224
+				 * @param string $title The title to be output.
2225
+				 * @param string $cpt_singular_name The singular title of the curent CPT.
2226
+				 * @param string $listing_type The CPT being requested. ie: gd_place.
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>
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 2231
             <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2232 2232
         </div>
2233 2233
         <?php
2234
-        $show_editor = get_option('geodir_tiny_editor_on_add_listing');
2235
-        $show_editor = !empty($show_editor) && in_array($listing_type, $show_editor) ? true : false;
2236
-        /**
2237
-         * Filter whether to show or don't show the editor.
2238
-         *
2239
-         * @since 1.6.16
2240
-         * @param bool $show_editor If true the editor will be available for description field.
2241
-         * @param object $package_info The listing package.
2242
-         * @param string $listing_type The current post type.
2243
-         * @param object $post The current post object.
2244
-         */
2245
-        $show_editor = apply_filters('geodir_description_field_show_editor', $show_editor, $package_info, $listing_type, $post);
2246
-
2247
-        $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2248
-        $desc_limit = '';
2249
-        /**
2250
-         * Filter the add listing description field character limit number.
2251
-         *
2252
-         * @since 1.0.0
2253
-         * @param int $desc_limit The amount of characters to limit the description to.
2254
-         */
2255
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2256
-        /**
2257
-         * Filter the add listing description field text.
2258
-         *
2259
-         * @since 1.0.0
2260
-         * @param string $desc The text for the description field.
2261
-         * @param int $desc_limit The character limit number if any.
2262
-         */
2263
-        $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2264
-        $desc_limit_msg = '';
2265
-        /**
2266
-         * Filter the add listing description limit message.
2267
-         *
2268
-         * This is the message shown if there is a limit applied to the amount of characters the description can use.
2269
-         *
2270
-         * @since 1.0.0
2271
-         * @param string $desc_limit_msg The limit message string if any.
2272
-         * @param int $desc_limit The character limit numer if any.
2273
-         */
2274
-        $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2234
+		$show_editor = get_option('geodir_tiny_editor_on_add_listing');
2235
+		$show_editor = !empty($show_editor) && in_array($listing_type, $show_editor) ? true : false;
2236
+		/**
2237
+		 * Filter whether to show or don't show the editor.
2238
+		 *
2239
+		 * @since 1.6.16
2240
+		 * @param bool $show_editor If true the editor will be available for description field.
2241
+		 * @param object $package_info The listing package.
2242
+		 * @param string $listing_type The current post type.
2243
+		 * @param object $post The current post object.
2244
+		 */
2245
+		$show_editor = apply_filters('geodir_description_field_show_editor', $show_editor, $package_info, $listing_type, $post);
2246
+
2247
+		$desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2248
+		$desc_limit = '';
2249
+		/**
2250
+		 * Filter the add listing description field character limit number.
2251
+		 *
2252
+		 * @since 1.0.0
2253
+		 * @param int $desc_limit The amount of characters to limit the description to.
2254
+		 */
2255
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2256
+		/**
2257
+		 * Filter the add listing description field text.
2258
+		 *
2259
+		 * @since 1.0.0
2260
+		 * @param string $desc The text for the description field.
2261
+		 * @param int $desc_limit The character limit number if any.
2262
+		 */
2263
+		$desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2264
+		$desc_limit_msg = '';
2265
+		/**
2266
+		 * Filter the add listing description limit message.
2267
+		 *
2268
+		 * This is the message shown if there is a limit applied to the amount of characters the description can use.
2269
+		 *
2270
+		 * @since 1.0.0
2271
+		 * @param string $desc_limit_msg The limit message string if any.
2272
+		 * @param int $desc_limit The character limit numer if any.
2273
+		 */
2274
+		$desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2275 2275
         
2276
-        $desc_class = '';
2277
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2278
-            /**
2279
-             * Called on the add listing page form for frontend just before the description field.
2280
-             *
2281
-             * @since 1.0.0
2282
-             */
2283
-            do_action('geodir_before_description_field');
2276
+		$desc_class = '';
2277
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2278
+			/**
2279
+			 * Called on the add listing page form for frontend just before the description field.
2280
+			 *
2281
+			 * @since 1.0.0
2282
+			 */
2283
+			do_action('geodir_before_description_field');
2284 2284
             
2285
-            $desc_class = ' required_field';
2286
-        } else {
2287
-            $desc_class = ' hidden';
2288
-        }
2289
-        ?>
2285
+			$desc_class = ' required_field';
2286
+		} else {
2287
+			$desc_class = ' hidden';
2288
+		}
2289
+		?>
2290 2290
         <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2291 2291
             <label><?php
2292
-                /**
2293
-                 * Filter the add listing page description input label.
2294
-                 *
2295
-                 * @since 1.6.11
2296
-                 * @param string $title The title to be output.
2297
-                 * @param string $cpt_singular_name The singular title of the curent CPT.
2298
-                 * @param string $listing_type The CPT being requested. ie: gd_place.
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>
2292
+				/**
2293
+				 * Filter the add listing page description input label.
2294
+				 *
2295
+				 * @since 1.6.11
2296
+				 * @param string $title The title to be output.
2297
+				 * @param string $cpt_singular_name The singular title of the curent CPT.
2298
+				 * @param string $listing_type The CPT being requested. ie: gd_place.
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>
2301 2301
             <?php
2302
-            if ($show_editor) {
2303
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2304
-            ?>
2302
+			if ($show_editor) {
2303
+				$editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2304
+			?>
2305 2305
                 <div class="editor" field_id="post_desc" field_type="editor">
2306 2306
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2307 2307
                 </div>
@@ -2315,56 +2315,56 @@  discard block
 block discarded – undo
2315 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) {
2319
-            /**
2320
-             * Called on the add listing page form for frontend just after the description field.
2321
-             *
2322
-             * @since 1.0.0
2323
-             */
2324
-            do_action('geodir_after_description_field');
2325
-        }
2318
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2319
+			/**
2320
+			 * Called on the add listing page form for frontend just after the description field.
2321
+			 *
2322
+			 * @since 1.0.0
2323
+			 */
2324
+			do_action('geodir_after_description_field');
2325
+		}
2326 2326
         
2327
-        $kw_tags = esc_attr(stripslashes($kw_tags));
2328
-        $kw_tags_count = TAGKW_TEXT_COUNT;
2329
-        $kw_tags_msg = TAGKW_MSG;
2330
-        /**
2331
-         * Filter the add listing tags character limit.
2332
-         *
2333
-         * @since 1.0.0
2334
-         * @param int $kw_tags_count The character count limit if any.
2335
-         */
2336
-        $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2337
-        /**
2338
-         * Filter the add listing tags field value.
2339
-         *
2340
-         * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2341
-         *
2342
-         * @since 1.0.0
2343
-         * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2344
-         * @param int $kw_tags_count The character count limit if any.
2345
-         */
2346
-        $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2347
-        /**
2348
-         * Filter the add listing tags field message text.
2349
-         *
2350
-         * @since 1.0.0
2351
-         * @param string $kw_tags_msg The message shown under the field.
2352
-         * @param int $kw_tags_count The character count limit if any.
2353
-         */
2354
-        $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2327
+		$kw_tags = esc_attr(stripslashes($kw_tags));
2328
+		$kw_tags_count = TAGKW_TEXT_COUNT;
2329
+		$kw_tags_msg = TAGKW_MSG;
2330
+		/**
2331
+		 * Filter the add listing tags character limit.
2332
+		 *
2333
+		 * @since 1.0.0
2334
+		 * @param int $kw_tags_count The character count limit if any.
2335
+		 */
2336
+		$kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2337
+		/**
2338
+		 * Filter the add listing tags field value.
2339
+		 *
2340
+		 * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2341
+		 *
2342
+		 * @since 1.0.0
2343
+		 * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2344
+		 * @param int $kw_tags_count The character count limit if any.
2345
+		 */
2346
+		$kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2347
+		/**
2348
+		 * Filter the add listing tags field message text.
2349
+		 *
2350
+		 * @since 1.0.0
2351
+		 * @param string $kw_tags_msg The message shown under the field.
2352
+		 * @param int $kw_tags_count The character count limit if any.
2353
+		 */
2354
+		$kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2355 2355
         
2356
-        $tags_class = '';
2357
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2358
-            /**
2359
-             * Called on the add listing page form for frontend just before the tags field.
2360
-             *
2361
-             * @since 1.0.0
2362
-             */
2363
-            do_action('geodir_before_listing_tags_field');
2364
-        } else {
2365
-            $tags_class = ' hidden';
2366
-        }
2367
-        ?>
2356
+		$tags_class = '';
2357
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2358
+			/**
2359
+			 * Called on the add listing page form for frontend just before the tags field.
2360
+			 *
2361
+			 * @since 1.0.0
2362
+			 */
2363
+			do_action('geodir_before_listing_tags_field');
2364
+		} else {
2365
+			$tags_class = ' hidden';
2366
+		}
2367
+		?>
2368 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"
@@ -2372,90 +2372,90 @@  discard block
 block discarded – undo
2372 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) {
2376
-            /**
2377
-             * Called on the add listing page form for frontend just after the tags field.
2378
-             *
2379
-             * @since 1.0.0
2380
-             */
2381
-            do_action('geodir_after_listing_tags_field');
2382
-        }
2375
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2376
+			/**
2377
+			 * Called on the add listing page form for frontend just after the tags field.
2378
+			 *
2379
+			 * @since 1.0.0
2380
+			 */
2381
+			do_action('geodir_after_listing_tags_field');
2382
+		}
2383 2383
         
2384
-        $package_info = array();
2385
-        $package_info = geodir_post_package_info($package_info, $post);
2384
+		$package_info = array();
2385
+		$package_info = geodir_post_package_info($package_info, $post);
2386 2386
         
2387
-        geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2387
+		geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2388 2388
         
2389
-        // adjust values here
2390
-        $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
2391
-
2392
-        $multiple = true; // allow multiple files upload
2389
+		// adjust values here
2390
+		$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
2393 2391
 
2394
-        $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2392
+		$multiple = true; // allow multiple files upload
2395 2393
 
2396
-        $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2394
+		$width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2397 2395
 
2398
-        $thumb_img_arr = array();
2399
-        $totImg = 0;
2400
-        if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2401
-            $post = (object)$gd_session->get('listing');
2402
-            if (isset($post->post_images))
2403
-                $curImages = trim($post->post_images, ",");
2396
+		$height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2404 2397
 
2398
+		$thumb_img_arr = array();
2399
+		$totImg = 0;
2400
+		if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2401
+			$post = (object)$gd_session->get('listing');
2402
+			if (isset($post->post_images))
2403
+				$curImages = trim($post->post_images, ",");
2405 2404
 
2406
-            if ($curImages != '') {
2407
-                $curImages_array = explode(',', $curImages);
2408
-                $totImg = count($curImages_array);
2409
-            }
2410 2405
 
2411
-            $listing_type = $post->listing_type;
2406
+			if ($curImages != '') {
2407
+				$curImages_array = explode(',', $curImages);
2408
+				$totImg = count($curImages_array);
2409
+			}
2412 2410
 
2413
-        } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2414
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2415
-            $listing_type = $post->post_type;
2416
-            $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2411
+			$listing_type = $post->listing_type;
2417 2412
 
2418
-        } else {
2419
-            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2420
-        }
2413
+		} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2414
+			$post = geodir_get_post_info((int)$_REQUEST['pid']);
2415
+			$listing_type = $post->post_type;
2416
+			$thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2421 2417
 
2418
+		} else {
2419
+			$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2420
+		}
2422 2421
 
2423
-        if (!empty($thumb_img_arr)) {
2424
-            foreach ($thumb_img_arr as $img) {
2425
-                //$curImages = $img->src.",";
2426
-            }
2427 2422
 
2428
-            $totImg = count((array)$thumb_img_arr);
2429
-        }
2423
+		if (!empty($thumb_img_arr)) {
2424
+			foreach ($thumb_img_arr as $img) {
2425
+				//$curImages = $img->src.",";
2426
+			}
2430 2427
 
2431
-        if ($curImages != '')
2432
-            $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2433
-        else
2434
-            $svalue = '';
2435
-
2436
-        $image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0';
2437
-        $show_image_input_box = ($image_limit != '0');
2438
-        /**
2439
-         * Filter to be able to show/hide the image upload section of the add listing form.
2440
-         *
2441
-         * @since 1.0.0
2442
-         * @param bool $show_image_input_box Set true to show. Set false to not show.
2443
-         * @param string $listing_type The custom post type slug.
2444
-         */
2445
-        $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2446
-        if ($show_image_input_box) {
2447
-            ?>
2428
+			$totImg = count((array)$thumb_img_arr);
2429
+		}
2430
+
2431
+		if ($curImages != '')
2432
+			$svalue = $curImages; // this will be initial value of the above form field. Image urls.
2433
+		else
2434
+			$svalue = '';
2435
+
2436
+		$image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0';
2437
+		$show_image_input_box = ($image_limit != '0');
2438
+		/**
2439
+		 * Filter to be able to show/hide the image upload section of the add listing form.
2440
+		 *
2441
+		 * @since 1.0.0
2442
+		 * @param bool $show_image_input_box Set true to show. Set false to not show.
2443
+		 * @param string $listing_type The custom post type slug.
2444
+		 */
2445
+		$show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2446
+		if ($show_image_input_box) {
2447
+			?>
2448 2448
 
2449 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>';
2452
-                } ?>
2451
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2452
+				} ?>
2453 2453
                 <?php if ($image_limit > 1) {
2454
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2455
-                } ?>
2454
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2455
+				} ?>
2456 2456
                 <?php if ($image_limit == '') {
2457
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2458
-                } ?>
2457
+					echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2458
+				} ?>
2459 2459
             </h5>
2460 2460
 
2461 2461
             <div class="geodir_form_row clearfix" id="<?php echo $id; ?>dropbox"
@@ -2493,12 +2493,12 @@  discard block
 block discarded – undo
2493 2493
         <?php } ?>
2494 2494
 
2495 2495
         <?php
2496
-        /**
2497
-         * Called on the add listing page form for frontend just after the image upload field.
2498
-         *
2499
-         * @since 1.0.0
2500
-         */
2501
-        do_action('geodir_after_main_form_fields');?>
2496
+		/**
2497
+		 * Called on the add listing page form for frontend just after the image upload field.
2498
+		 *
2499
+		 * @since 1.0.0
2500
+		 */
2501
+		do_action('geodir_after_main_form_fields');?>
2502 2502
 
2503 2503
 
2504 2504
         <!-- add captcha code -->
@@ -2527,7 +2527,7 @@  discard block
 block discarded – undo
2527 2527
 
2528 2528
     </form>
2529 2529
     <?php
2530
-    wp_reset_query();
2530
+	wp_reset_query();
2531 2531
 }
2532 2532
 
2533 2533
 /**
@@ -2538,7 +2538,7 @@  discard block
 block discarded – undo
2538 2538
  */
2539 2539
 function geodir_add_listing_sidebar_widget_area()
2540 2540
 {
2541
-    dynamic_sidebar('geodir_add_listing_sidebar');
2541
+	dynamic_sidebar('geodir_add_listing_sidebar');
2542 2542
 }
2543 2543
 
2544 2544
 add_action('geodir_add_listing_sidebar_inside', 'geodir_add_listing_sidebar_widget_area', 10);
@@ -2553,16 +2553,16 @@  discard block
 block discarded – undo
2553 2553
  */
2554 2554
 function geodir_action_add_listing_sidebar()
2555 2555
 {
2556
-    /** This action is documented in geodirectory_template_actions.php */
2557
-    do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2558
-    /**
2559
-     * This is used to add the content to the add listing page sidebar.
2560
-     *
2561
-     * @since 1.0.0
2562
-     */
2563
-    do_action('geodir_add_listing_sidebar_inside');
2564
-    /** This action is documented in geodirectory_template_actions.php */
2565
-    do_action('geodir_sidebar_right_close', 'details-page');
2556
+	/** This action is documented in geodirectory_template_actions.php */
2557
+	do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2558
+	/**
2559
+	 * This is used to add the content to the add listing page sidebar.
2560
+	 *
2561
+	 * @since 1.0.0
2562
+	 */
2563
+	do_action('geodir_add_listing_sidebar_inside');
2564
+	/** This action is documented in geodirectory_template_actions.php */
2565
+	do_action('geodir_sidebar_right_close', 'details-page');
2566 2566
 }
2567 2567
 
2568 2568
 ###############################################
@@ -2579,11 +2579,11 @@  discard block
 block discarded – undo
2579 2579
  */
2580 2580
 function geodir_action_geodir_sidebar_signup_top()
2581 2581
 {
2582
-    ?>
2582
+	?>
2583 2583
     <div
2584 2584
         class="<?php
2585
-        /** This action is documented in geodirectory_template_actions.php */
2586
-        echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2585
+		/** This action is documented in geodirectory_template_actions.php */
2586
+		echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2587 2587
         <?php dynamic_sidebar('Reg/Login Top Section');?>
2588 2588
     </div><!-- clearfix ends here-->
2589 2589
 <?php
@@ -2602,9 +2602,9 @@  discard block
 block discarded – undo
2602 2602
 function geodir_action_signup_forms()
2603 2603
 {
2604 2604
 
2605
-    global $user_login;
2605
+	global $user_login;
2606 2606
 
2607
-    ?>
2607
+	?>
2608 2608
     <script type="text/javascript">
2609 2609
         <?php if ( $user_login ) { ?>
2610 2610
         setTimeout(function () {
@@ -2640,65 +2640,65 @@  discard block
 block discarded – undo
2640 2640
         <?php } ?>
2641 2641
     </script><?php
2642 2642
 
2643
-    global $errors;
2644
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2645
-        $errors->add('claim_login', LOGIN_CLAIM);
2646
-
2647
-    if (!empty($errors)) {
2648
-        foreach ($errors as $errorsObj) {
2649
-            foreach ($errorsObj as $key => $val) {
2650
-                for ($i = 0; $i < count($val); $i++) {
2651
-                    echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2652
-                    $registration_error_msg = 1;
2653
-                }
2654
-            }
2655
-        }
2656
-    }
2643
+	global $errors;
2644
+	if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2645
+		$errors->add('claim_login', LOGIN_CLAIM);
2646
+
2647
+	if (!empty($errors)) {
2648
+		foreach ($errors as $errorsObj) {
2649
+			foreach ($errorsObj as $key => $val) {
2650
+				for ($i = 0; $i < count($val); $i++) {
2651
+					echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2652
+					$registration_error_msg = 1;
2653
+				}
2654
+			}
2655
+		}
2656
+	}
2657 2657
 
2658
-    if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2659
-        ?>
2658
+	if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2659
+		?>
2660 2660
 
2661 2661
         <div class="login_form">
2662 2662
             <?php
2663
-            /**
2664
-             * Contains login form template.
2665
-             *
2666
-             * @since 1.0.0
2667
-             */
2668
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2663
+			/**
2664
+			 * Contains login form template.
2665
+			 *
2666
+			 * @since 1.0.0
2667
+			 */
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') { ?>
2672 2672
 
2673 2673
         <div class="registration_form">
2674 2674
             <?php
2675
-            /**
2676
-             * Contains registration form template.
2677
-             *
2678
-             * @since 1.0.0
2679
-             */
2680
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2675
+			/**
2676
+			 * Contains registration form template.
2677
+			 *
2678
+			 * @since 1.0.0
2679
+			 */
2680
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2681 2681
         </div>
2682 2682
 
2683 2683
     <?php } else { ?>
2684 2684
 
2685 2685
         <div class="login_form_l">
2686 2686
             <?php
2687
-            /**
2688
-             * Contains login form template.
2689
-             *
2690
-             * @since 1.0.0
2691
-             */
2692
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2687
+			/**
2688
+			 * Contains login form template.
2689
+			 *
2690
+			 * @since 1.0.0
2691
+			 */
2692
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2693 2693
         </div>
2694 2694
         <div class="registration_form_r">
2695 2695
             <?php
2696
-            /**
2697
-             * Contains registration form template.
2698
-             *
2699
-             * @since 1.0.0
2700
-             */
2701
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2696
+			/**
2697
+			 * Contains registration form template.
2698
+			 *
2699
+			 * @since 1.0.0
2700
+			 */
2701
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2702 2702
         </div>
2703 2703
 
2704 2704
     <?php }?>
@@ -2729,66 +2729,66 @@  discard block
 block discarded – undo
2729 2729
  */
2730 2730
 function geodir_action_author_page_title()
2731 2731
 {
2732
-    global $term;
2732
+	global $term;
2733 2733
 
2734
-    $gd_post_type = geodir_get_current_posttype();
2735
-    $post_type_info = get_post_type_object($gd_post_type);
2734
+	$gd_post_type = geodir_get_current_posttype();
2735
+	$post_type_info = get_post_type_object($gd_post_type);
2736 2736
 
2737
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2738
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2739
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2740
-    }
2737
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
2738
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2739
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2740
+	}
2741 2741
 
2742
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2743
-    $single_name = $post_type_info->labels->singular_name;
2742
+	$list_title = $add_string_in_title . $post_type_info->labels->name;
2743
+	$single_name = $post_type_info->labels->singular_name;
2744 2744
 
2745
-    $taxonomy = geodir_get_taxonomies($gd_post_type);
2745
+	$taxonomy = geodir_get_taxonomies($gd_post_type);
2746 2746
 
2747
-    if (!empty($term)) {
2748
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
2749
-        if (!empty($current_term))
2750
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2751
-    }
2747
+	if (!empty($term)) {
2748
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
2749
+		if (!empty($current_term))
2750
+			$list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2751
+	}
2752 2752
 
2753 2753
 
2754
-    if (is_search()) {
2755
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2754
+	if (is_search()) {
2755
+		$list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2756 2756
 
2757
-    }
2758
-    /** This action is documented in geodirectory_template_actions.php */
2759
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2760
-    /** This action is documented in geodirectory_template_actions.php */
2761
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2757
+	}
2758
+	/** This action is documented in geodirectory_template_actions.php */
2759
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2760
+	/** This action is documented in geodirectory_template_actions.php */
2761
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2762 2762
 
2763
-    $title = $list_title;
2764
-    if(geodir_is_page('author')){
2765
-        $gd_page = 'author';
2766
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2767
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2768
-        }else{
2769
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2770
-        }
2763
+	$title = $list_title;
2764
+	if(geodir_is_page('author')){
2765
+		$gd_page = 'author';
2766
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2767
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2768
+		}else{
2769
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2770
+		}
2771 2771
 
2772
-    }
2772
+	}
2773 2773
 
2774 2774
 
2775
-    /**
2776
-     * Filter page title to replace variables.
2777
-     *
2778
-     * @since 1.5.4
2779
-     * @param string $title The page title including variables.
2780
-     * @param string $gd_page The GeoDirectory page type if any.
2781
-     */
2782
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2775
+	/**
2776
+	 * Filter page title to replace variables.
2777
+	 *
2778
+	 * @since 1.5.4
2779
+	 * @param string $title The page title including variables.
2780
+	 * @param string $gd_page The GeoDirectory page type if any.
2781
+	 */
2782
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2783 2783
 
2784
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2785
-        /**
2786
-         * Filter the author page title text.
2787
-         *
2788
-         * @since 1.0.0
2789
-         * @param string $list_title The title for the page.
2790
-         */
2791
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2784
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2785
+		/**
2786
+		 * Filter the author page title text.
2787
+		 *
2788
+		 * @since 1.0.0
2789
+		 * @param string $list_title The title for the page.
2790
+		 */
2791
+		apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2792 2792
 }
2793 2793
 
2794 2794
 
@@ -2806,11 +2806,11 @@  discard block
 block discarded – undo
2806 2806
  */
2807 2807
 function geodir_action_geodir_sidebar_author_top()
2808 2808
 {
2809
-    if (get_option('geodir_show_author_top_section')) { ?>
2809
+	if (get_option('geodir_show_author_top_section')) { ?>
2810 2810
         <div
2811 2811
             class="<?php
2812
-            /** This action is documented in geodirectory_template_actions.php */
2813
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2812
+			/** This action is documented in geodirectory_template_actions.php */
2813
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2814 2814
             <?php dynamic_sidebar('geodir_author_top'); ?>
2815 2815
         </div><!-- clearfix ends here-->
2816 2816
     <?php }
@@ -2826,7 +2826,7 @@  discard block
 block discarded – undo
2826 2826
  */
2827 2827
 function geodir_author_left_section()
2828 2828
 {
2829
-    if (get_option('geodir_show_author_left_section')) { ?>
2829
+	if (get_option('geodir_show_author_left_section')) { ?>
2830 2830
         <div class="geodir-content-left geodir-sidebar-wrap">
2831 2831
             <?php dynamic_sidebar('geodir_author_left_sidebar'); ?>
2832 2832
         </div><!-- end geodir-content-left -->
@@ -2847,19 +2847,19 @@  discard block
 block discarded – undo
2847 2847
  */
2848 2848
 function geodir_action_author_sidebar_left()
2849 2849
 {
2850
-    if (get_option('geodir_show_author_left_section')) {
2850
+	if (get_option('geodir_show_author_left_section')) {
2851 2851
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
2852
-        /** This action is documented in geodirectory_template_actions.php */
2853
-        do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2854
-        /**
2855
-         * This is used to add the content to the author page left sidebar (if active).
2856
-         *
2857
-         * @since 1.0.0
2858
-         */
2859
-        do_action('geodir_author_sidebar_left_inside');
2860
-        /** This action is documented in geodirectory_template_actions.php */
2861
-        do_action('geodir_sidebar_left_close', 'author-page');
2862
-    }
2852
+		/** This action is documented in geodirectory_template_actions.php */
2853
+		do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2854
+		/**
2855
+		 * This is used to add the content to the author page left sidebar (if active).
2856
+		 *
2857
+		 * @since 1.0.0
2858
+		 */
2859
+		do_action('geodir_author_sidebar_left_inside');
2860
+		/** This action is documented in geodirectory_template_actions.php */
2861
+		do_action('geodir_sidebar_left_close', 'author-page');
2862
+	}
2863 2863
 }
2864 2864
 
2865 2865
 /**
@@ -2872,7 +2872,7 @@  discard block
 block discarded – undo
2872 2872
  */
2873 2873
 function geodir_author_right_section()
2874 2874
 {
2875
-    if (get_option('geodir_show_author_right_section')) { ?>
2875
+	if (get_option('geodir_show_author_right_section')) { ?>
2876 2876
         <div class="geodir-content-right geodir-sidebar-wrap">
2877 2877
             <?php dynamic_sidebar('geodir_author_right_sidebar'); ?>
2878 2878
         </div><!-- end geodir-content-right -->
@@ -2892,18 +2892,18 @@  discard block
 block discarded – undo
2892 2892
  */
2893 2893
 function geodir_action_author_sidebar_right()
2894 2894
 {
2895
-    if (get_option('geodir_show_author_right_section')) {
2896
-        /** This action is documented in geodirectory_template_actions.php */
2897
-        do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2898
-        /**
2899
-         * This is used to add the content to the author page right sidebar (if active).
2900
-         *
2901
-         * @since 1.0.0
2902
-         */
2903
-        do_action('geodir_author_sidebar_right_inside');
2904
-        /** This action is documented in geodirectory_template_actions.php */
2905
-        do_action('geodir_sidebar_right_close', 'author-page');
2906
-    }
2895
+	if (get_option('geodir_show_author_right_section')) {
2896
+		/** This action is documented in geodirectory_template_actions.php */
2897
+		do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2898
+		/**
2899
+		 * This is used to add the content to the author page right sidebar (if active).
2900
+		 *
2901
+		 * @since 1.0.0
2902
+		 */
2903
+		do_action('geodir_author_sidebar_right_inside');
2904
+		/** This action is documented in geodirectory_template_actions.php */
2905
+		do_action('geodir_sidebar_right_close', 'author-page');
2906
+	}
2907 2907
 }
2908 2908
 
2909 2909
 /**
@@ -2915,14 +2915,14 @@  discard block
 block discarded – undo
2915 2915
  */
2916 2916
 function geodir_action_author_content_inside()
2917 2917
 {
2918
-    global $gridview_columns;
2919
-    $listing_view = get_option('geodir_author_view');
2920
-    if (strstr($listing_view, 'gridview')) {
2921
-        $gridview_columns = $listing_view;
2922
-        $listing_view_exp = explode('_', $listing_view);
2923
-        $listing_view = $listing_view_exp[0];
2924
-    }
2925
-    geodir_get_template_part('listing', 'listview');
2918
+	global $gridview_columns;
2919
+	$listing_view = get_option('geodir_author_view');
2920
+	if (strstr($listing_view, 'gridview')) {
2921
+		$gridview_columns = $listing_view;
2922
+		$listing_view_exp = explode('_', $listing_view);
2923
+		$listing_view = $listing_view_exp[0];
2924
+	}
2925
+	geodir_get_template_part('listing', 'listview');
2926 2926
 }
2927 2927
 
2928 2928
 add_action('geodir_author_content_inside', 'geodir_action_author_content_inside', 10);
@@ -2937,22 +2937,22 @@  discard block
 block discarded – undo
2937 2937
  */
2938 2938
 function geodir_action_author_content()
2939 2939
 {
2940
-    /** This action is documented in geodirectory_template_actions.php */
2941
-    do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2942
-    echo '<div class="clearfix">';
2943
-    /** This action is documented in geodirectory_template_actions.php */
2944
-    do_action('geodir_before_listing');
2945
-    echo '</div>';
2946
-    /**
2947
-     * This is used to add the content to the author page main content.
2948
-     *
2949
-     * @since 1.0.0
2950
-     */
2951
-    do_action('geodir_author_content_inside');
2952
-    /** This action is documented in geodirectory_template_actions.php */
2953
-    do_action('geodir_after_listing');
2954
-    /** This action is documented in geodirectory_template_actions.php */
2955
-    do_action('geodir_main_content_close', 'author-page');
2940
+	/** This action is documented in geodirectory_template_actions.php */
2941
+	do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2942
+	echo '<div class="clearfix">';
2943
+	/** This action is documented in geodirectory_template_actions.php */
2944
+	do_action('geodir_before_listing');
2945
+	echo '</div>';
2946
+	/**
2947
+	 * This is used to add the content to the author page main content.
2948
+	 *
2949
+	 * @since 1.0.0
2950
+	 */
2951
+	do_action('geodir_author_content_inside');
2952
+	/** This action is documented in geodirectory_template_actions.php */
2953
+	do_action('geodir_after_listing');
2954
+	/** This action is documented in geodirectory_template_actions.php */
2955
+	do_action('geodir_main_content_close', 'author-page');
2956 2956
 }
2957 2957
 
2958 2958
 add_action('geodir_sidebar_author_bottom_section', 'geodir_action_sidebar_author_bottom_section', 10);
@@ -2966,11 +2966,11 @@  discard block
 block discarded – undo
2966 2966
  */
2967 2967
 function geodir_action_sidebar_author_bottom_section()
2968 2968
 {
2969
-    if (get_option('geodir_show_author_bottom_section')) { ?>
2969
+	if (get_option('geodir_show_author_bottom_section')) { ?>
2970 2970
         <div
2971 2971
             class="<?php
2972
-            /** This action is documented in geodirectory_template_actions.php */
2973
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2972
+			/** This action is documented in geodirectory_template_actions.php */
2973
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2974 2974
             <?php dynamic_sidebar('geodir_author_bottom'); ?>
2975 2975
         </div><!-- clearfix ends here-->
2976 2976
     <?php }
@@ -2989,23 +2989,23 @@  discard block
 block discarded – undo
2989 2989
  */
2990 2990
 function geodir_action_search_page_title()
2991 2991
 {
2992
-    $gd_post_type = geodir_get_current_posttype();
2993
-    $post_type_info = get_post_type_object($gd_post_type);
2992
+	$gd_post_type = geodir_get_current_posttype();
2993
+	$post_type_info = get_post_type_object($gd_post_type);
2994 2994
 
2995
-    $pt_name = '';
2996
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2995
+	$pt_name = '';
2996
+	if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2997 2997
 
2998
-    if (is_search()) {
2999
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2998
+	if (is_search()) {
2999
+		$list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
3000 3000
 
3001
-    }
3002
-    /** This action is documented in geodirectory_template_actions.php */
3003
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
3004
-    /** This action is documented in geodirectory_template_actions.php */
3005
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
3006
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
3007
-        /** This action is documented in geodirectory_template_actions.php */
3008
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
3001
+	}
3002
+	/** This action is documented in geodirectory_template_actions.php */
3003
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
3004
+	/** This action is documented in geodirectory_template_actions.php */
3005
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
3006
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
3007
+		/** This action is documented in geodirectory_template_actions.php */
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
@@ -3021,11 +3021,11 @@  discard block
 block discarded – undo
3021 3021
  */
3022 3022
 function geodir_action_geodir_sidebar_search_top()
3023 3023
 {
3024
-    if (get_option('geodir_show_search_top_section')) { ?>
3024
+	if (get_option('geodir_show_search_top_section')) { ?>
3025 3025
         <div
3026 3026
             class="<?php
3027
-            /** This action is documented in geodirectory_template_actions.php */
3028
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
3027
+			/** This action is documented in geodirectory_template_actions.php */
3028
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
3029 3029
             <?php dynamic_sidebar('geodir_search_top'); ?>
3030 3030
         </div><!-- clearfix ends here-->
3031 3031
     <?php }
@@ -3041,7 +3041,7 @@  discard block
 block discarded – undo
3041 3041
  */
3042 3042
 function geodir_search_left_section()
3043 3043
 {
3044
-    if (get_option('geodir_show_search_left_section')) { ?>
3044
+	if (get_option('geodir_show_search_left_section')) { ?>
3045 3045
         <div class="geodir-content-left geodir-sidebar-wrap">
3046 3046
             <?php dynamic_sidebar('geodir_search_left_sidebar'); ?>
3047 3047
         </div><!-- end geodir-content-left -->
@@ -3061,19 +3061,19 @@  discard block
 block discarded – undo
3061 3061
  */
3062 3062
 function geodir_action_search_sidebar_left()
3063 3063
 {
3064
-    if (get_option('geodir_show_search_left_section')) {
3064
+	if (get_option('geodir_show_search_left_section')) {
3065 3065
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3066
-        /** This action is documented in geodirectory_template_actions.php */
3067
-        do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3068
-        /**
3069
-         * This is used to add the content to the search page left sidebar (if active).
3070
-         *
3071
-         * @since 1.0.0
3072
-         */
3073
-        do_action('geodir_search_sidebar_left_inside');
3074
-        /** This action is documented in geodirectory_template_actions.php */
3075
-        do_action('geodir_sidebar_left_close', 'search-page');
3076
-    }
3066
+		/** This action is documented in geodirectory_template_actions.php */
3067
+		do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3068
+		/**
3069
+		 * This is used to add the content to the search page left sidebar (if active).
3070
+		 *
3071
+		 * @since 1.0.0
3072
+		 */
3073
+		do_action('geodir_search_sidebar_left_inside');
3074
+		/** This action is documented in geodirectory_template_actions.php */
3075
+		do_action('geodir_sidebar_left_close', 'search-page');
3076
+	}
3077 3077
 }
3078 3078
 
3079 3079
 /**
@@ -3086,7 +3086,7 @@  discard block
 block discarded – undo
3086 3086
  */
3087 3087
 function geodir_search_right_section()
3088 3088
 {
3089
-    if (get_option('geodir_show_search_right_section')) { ?>
3089
+	if (get_option('geodir_show_search_right_section')) { ?>
3090 3090
         <div class="geodir-content-right geodir-sidebar-wrap">
3091 3091
             <?php dynamic_sidebar('geodir_search_right_sidebar'); ?>
3092 3092
         </div><!-- end geodir-content-right -->
@@ -3106,18 +3106,18 @@  discard block
 block discarded – undo
3106 3106
  */
3107 3107
 function geodir_action_search_sidebar_right()
3108 3108
 {
3109
-    if (get_option('geodir_show_search_right_section')) {
3110
-        /** This action is documented in geodirectory_template_actions.php */
3111
-        do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3112
-        /**
3113
-         * This is used to add the content to the search page right sidebar (if active).
3114
-         *
3115
-         * @since 1.0.0
3116
-         */
3117
-        do_action('geodir_search_sidebar_right_inside');
3118
-        /** This action is documented in geodirectory_template_actions.php */
3119
-        do_action('geodir_sidebar_right_close', 'search-page');
3120
-    }
3109
+	if (get_option('geodir_show_search_right_section')) {
3110
+		/** This action is documented in geodirectory_template_actions.php */
3111
+		do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3112
+		/**
3113
+		 * This is used to add the content to the search page right sidebar (if active).
3114
+		 *
3115
+		 * @since 1.0.0
3116
+		 */
3117
+		do_action('geodir_search_sidebar_right_inside');
3118
+		/** This action is documented in geodirectory_template_actions.php */
3119
+		do_action('geodir_sidebar_right_close', 'search-page');
3120
+	}
3121 3121
 }
3122 3122
 
3123 3123
 
@@ -3132,11 +3132,11 @@  discard block
 block discarded – undo
3132 3132
  */
3133 3133
 function geodir_action_sidebar_search_bottom_section()
3134 3134
 {
3135
-    if (get_option('geodir_show_search_bottom_section')) { ?>
3135
+	if (get_option('geodir_show_search_bottom_section')) { ?>
3136 3136
         <div
3137 3137
             class="<?php
3138
-            /** This action is documented in geodirectory_template_actions.php */
3139
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3138
+			/** This action is documented in geodirectory_template_actions.php */
3139
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3140 3140
             <?php dynamic_sidebar('geodir_search_bottom'); ?>
3141 3141
         </div><!-- clearfix ends here-->
3142 3142
     <?php }
@@ -3151,14 +3151,14 @@  discard block
 block discarded – undo
3151 3151
  */
3152 3152
 function geodir_action_search_content_inside()
3153 3153
 {
3154
-    global $gridview_columns;
3155
-    $listing_view = get_option('geodir_search_view');
3156
-    if (strstr($listing_view, 'gridview')) {
3157
-        $gridview_columns = $listing_view;
3158
-        $listing_view_exp = explode('_', $listing_view);
3159
-        $listing_view = $listing_view_exp[0];
3160
-    }
3161
-    geodir_get_template_part('listing', 'listview');
3154
+	global $gridview_columns;
3155
+	$listing_view = get_option('geodir_search_view');
3156
+	if (strstr($listing_view, 'gridview')) {
3157
+		$gridview_columns = $listing_view;
3158
+		$listing_view_exp = explode('_', $listing_view);
3159
+		$listing_view = $listing_view_exp[0];
3160
+	}
3161
+	geodir_get_template_part('listing', 'listview');
3162 3162
 }
3163 3163
 
3164 3164
 add_action('geodir_search_content_inside', 'geodir_action_search_content_inside', 10);
@@ -3174,22 +3174,22 @@  discard block
 block discarded – undo
3174 3174
  */
3175 3175
 function geodir_action_search_content()
3176 3176
 {
3177
-    /** This action is documented in geodirectory_template_actions.php */
3178
-    do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3179
-    echo '<div class="clearfix">';
3180
-    /** This action is documented in geodirectory_template_actions.php */
3181
-    do_action('geodir_before_listing');
3182
-    echo '</div>';
3183
-    /**
3184
-     * This is used to add the content to the search page main content.
3185
-     *
3186
-     * @since 1.0.0
3187
-     */
3188
-    do_action('geodir_search_content_inside');
3189
-    /** This action is documented in geodirectory_template_actions.php */
3190
-    do_action('geodir_after_listing');
3191
-    /** This action is documented in geodirectory_template_actions.php */
3192
-    do_action('geodir_main_content_close', 'search-page');
3177
+	/** This action is documented in geodirectory_template_actions.php */
3178
+	do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3179
+	echo '<div class="clearfix">';
3180
+	/** This action is documented in geodirectory_template_actions.php */
3181
+	do_action('geodir_before_listing');
3182
+	echo '</div>';
3183
+	/**
3184
+	 * This is used to add the content to the search page main content.
3185
+	 *
3186
+	 * @since 1.0.0
3187
+	 */
3188
+	do_action('geodir_search_content_inside');
3189
+	/** This action is documented in geodirectory_template_actions.php */
3190
+	do_action('geodir_after_listing');
3191
+	/** This action is documented in geodirectory_template_actions.php */
3192
+	do_action('geodir_main_content_close', 'search-page');
3193 3193
 }
3194 3194
 
3195 3195
 ###############################################
@@ -3212,11 +3212,11 @@  discard block
 block discarded – undo
3212 3212
  */
3213 3213
 function geodir_action_geodir_sidebar_home_top()
3214 3214
 {
3215
-    if (get_option('geodir_show_home_top_section')) { ?>
3215
+	if (get_option('geodir_show_home_top_section')) { ?>
3216 3216
         <div
3217 3217
             class="<?php
3218
-            /** This action is documented in geodirectory_template_actions.php */
3219
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3218
+			/** This action is documented in geodirectory_template_actions.php */
3219
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3220 3220
             <?php dynamic_sidebar('geodir_home_top'); ?>
3221 3221
         </div><!-- clearfix ends here-->
3222 3222
     <?php }
@@ -3232,7 +3232,7 @@  discard block
 block discarded – undo
3232 3232
  */
3233 3233
 function geodir_home_left_section()
3234 3234
 {
3235
-    if (get_option('geodir_show_home_left_section')) { ?>
3235
+	if (get_option('geodir_show_home_left_section')) { ?>
3236 3236
         <div class="geodir-content-left geodir-sidebar-wrap">
3237 3237
             <?php dynamic_sidebar('geodir_home_left'); ?>
3238 3238
         </div><!-- end geodir-content-left -->
@@ -3254,19 +3254,19 @@  discard block
 block discarded – undo
3254 3254
  */
3255 3255
 function geodir_action_home_sidebar_left()
3256 3256
 {
3257
-    if (get_option('geodir_show_home_left_section')) {
3257
+	if (get_option('geodir_show_home_left_section')) {
3258 3258
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3259
-        /** This action is documented in geodirectory_template_actions.php */
3260
-        do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3261
-        /**
3262
-         * This is used to add the content to the home page left sidebar (if active).
3263
-         *
3264
-         * @since 1.0.0
3265
-         */
3266
-        do_action('geodir_home_sidebar_left_inside');
3267
-        /** This action is documented in geodirectory_template_actions.php */
3268
-        do_action('geodir_sidebar_left_close', 'home-page');
3269
-    }
3259
+		/** This action is documented in geodirectory_template_actions.php */
3260
+		do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3261
+		/**
3262
+		 * This is used to add the content to the home page left sidebar (if active).
3263
+		 *
3264
+		 * @since 1.0.0
3265
+		 */
3266
+		do_action('geodir_home_sidebar_left_inside');
3267
+		/** This action is documented in geodirectory_template_actions.php */
3268
+		do_action('geodir_sidebar_left_close', 'home-page');
3269
+	}
3270 3270
 }
3271 3271
 
3272 3272
 /**
@@ -3279,7 +3279,7 @@  discard block
 block discarded – undo
3279 3279
  */
3280 3280
 function geodir_home_right_section()
3281 3281
 {
3282
-    if (get_option('geodir_show_home_right_section')) { ?>
3282
+	if (get_option('geodir_show_home_right_section')) { ?>
3283 3283
         <div class="geodir-content-right geodir-sidebar-wrap">
3284 3284
             <?php dynamic_sidebar('geodir_home_right'); ?>
3285 3285
         </div><!-- end geodir-content-right -->
@@ -3300,18 +3300,18 @@  discard block
 block discarded – undo
3300 3300
  */
3301 3301
 function geodir_action_home_sidebar_right()
3302 3302
 {
3303
-    if (get_option('geodir_show_home_right_section')) {
3304
-        /** This action is documented in geodirectory_template_actions.php */
3305
-        do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3306
-        /**
3307
-         * This is used to add the content to the home page right sidebar (if active).
3308
-         *
3309
-         * @since 1.0.0
3310
-         */
3311
-        do_action('geodir_home_sidebar_right_inside');
3312
-        /** This action is documented in geodirectory_template_actions.php */
3313
-        do_action('geodir_sidebar_right_close', 'home-page');
3314
-    }
3303
+	if (get_option('geodir_show_home_right_section')) {
3304
+		/** This action is documented in geodirectory_template_actions.php */
3305
+		do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3306
+		/**
3307
+		 * This is used to add the content to the home page right sidebar (if active).
3308
+		 *
3309
+		 * @since 1.0.0
3310
+		 */
3311
+		do_action('geodir_home_sidebar_right_inside');
3312
+		/** This action is documented in geodirectory_template_actions.php */
3313
+		do_action('geodir_sidebar_right_close', 'home-page');
3314
+	}
3315 3315
 }
3316 3316
 
3317 3317
 /**
@@ -3322,7 +3322,7 @@  discard block
 block discarded – undo
3322 3322
  */
3323 3323
 function geodir_action_home_content_inside()
3324 3324
 {
3325
-    dynamic_sidebar('geodir_home_content');
3325
+	dynamic_sidebar('geodir_home_content');
3326 3326
 }
3327 3327
 
3328 3328
 add_action('geodir_home_content_inside', 'geodir_action_home_content_inside', 10);
@@ -3337,28 +3337,28 @@  discard block
 block discarded – undo
3337 3337
  */
3338 3338
 function geodir_action_home_content()
3339 3339
 {
3340
-    /** This action is documented in geodirectory_template_actions.php */
3341
-    do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3342
-    /**
3343
-     * This called before the home page main content.
3344
-     *
3345
-     * @since 1.0.0
3346
-     */
3347
-    do_action('geodir_before_home_content');
3348
-    /**
3349
-     * This is used to add the content to the home page main content.
3350
-     *
3351
-     * @since 1.0.0
3352
-     */
3353
-    do_action('geodir_home_content_inside');
3354
-    /**
3355
-     * This is called after the homepage main content.
3356
-     *
3357
-     * @since 1.0.0
3358
-     */
3359
-    do_action('geodir_after_home_content');
3360
-    /** This action is documented in geodirectory_template_actions.php */
3361
-    do_action('geodir_main_content_close', 'home-page');
3340
+	/** This action is documented in geodirectory_template_actions.php */
3341
+	do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3342
+	/**
3343
+	 * This called before the home page main content.
3344
+	 *
3345
+	 * @since 1.0.0
3346
+	 */
3347
+	do_action('geodir_before_home_content');
3348
+	/**
3349
+	 * This is used to add the content to the home page main content.
3350
+	 *
3351
+	 * @since 1.0.0
3352
+	 */
3353
+	do_action('geodir_home_content_inside');
3354
+	/**
3355
+	 * This is called after the homepage main content.
3356
+	 *
3357
+	 * @since 1.0.0
3358
+	 */
3359
+	do_action('geodir_after_home_content');
3360
+	/** This action is documented in geodirectory_template_actions.php */
3361
+	do_action('geodir_main_content_close', 'home-page');
3362 3362
 }
3363 3363
 
3364 3364
 add_action('geodir_sidebar_location_bottom_section', 'geodir_action_sidebar_home_bottom_section', 10);
@@ -3373,11 +3373,11 @@  discard block
 block discarded – undo
3373 3373
  */
3374 3374
 function geodir_action_sidebar_home_bottom_section()
3375 3375
 {
3376
-    if (get_option('geodir_show_home_bottom_section')) { ?>
3376
+	if (get_option('geodir_show_home_bottom_section')) { ?>
3377 3377
         <div
3378 3378
             class="<?php
3379
-            /** This action is documented in geodirectory_template_actions.php */
3380
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3379
+			/** This action is documented in geodirectory_template_actions.php */
3380
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3381 3381
             <?php dynamic_sidebar('geodir_home_bottom'); ?>
3382 3382
         </div><!-- clearfix ends here-->
3383 3383
     <?php }
@@ -3405,13 +3405,13 @@  discard block
 block discarded – undo
3405 3405
  */
3406 3406
 function geodir_filter_listing_page_title($list_title)
3407 3407
 {
3408
-    if (is_search() && trim(get_search_query()) == '') {
3409
-        $gd_post_type = geodir_get_current_posttype();
3410
-        $post_type_info = get_post_type_object($gd_post_type);
3408
+	if (is_search() && trim(get_search_query()) == '') {
3409
+		$gd_post_type = geodir_get_current_posttype();
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');
3413
-    }
3414
-    return $list_title;
3412
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3413
+	}
3414
+	return $list_title;
3415 3415
 }
3416 3416
 
3417 3417
 add_action('geodir_message_not_found_on_listing', 'geodir_display_message_not_found_on_listing');
@@ -3426,62 +3426,62 @@  discard block
 block discarded – undo
3426 3426
  * @param string $gd_page The geodirectory page type. Default null.
3427 3427
  */
3428 3428
 function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
3429
-    global $post;
3430
-
3431
-    $gd_page_id = NULL;
3432
-    if ($gd_page == 'home-page' && geodir_is_page('home')) {
3433
-        $gd_page_id = geodir_home_page_id();
3434
-    } else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3435
-        $gd_page_id = geodir_preview_page_id();
3436
-    } else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3437
-        $gd_page_id = geodir_add_listing_page_id();
3438
-    } else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3439
-        $gd_page_id = geodir_success_page_id();
3440
-    } else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3441
-        $gd_page_id = geodir_location_page_id();
3442
-    } else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3443
-        $gd_page_id = geodir_info_page_id();
3444
-    } else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3445
-        $gd_page_id = geodir_login_page_id();
3446
-    } else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3447
-        $gd_page_id = geodir_payment_checkout_page_id();
3448
-    } else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3449
-        $gd_page_id = geodir_payment_invoices_page_id();
3450
-    }
3451
-
3452
-    if (!$gd_page_id > 0) {
3453
-        return;
3454
-    }
3429
+	global $post;
3430
+
3431
+	$gd_page_id = NULL;
3432
+	if ($gd_page == 'home-page' && geodir_is_page('home')) {
3433
+		$gd_page_id = geodir_home_page_id();
3434
+	} else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3435
+		$gd_page_id = geodir_preview_page_id();
3436
+	} else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3437
+		$gd_page_id = geodir_add_listing_page_id();
3438
+	} else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3439
+		$gd_page_id = geodir_success_page_id();
3440
+	} else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3441
+		$gd_page_id = geodir_location_page_id();
3442
+	} else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3443
+		$gd_page_id = geodir_info_page_id();
3444
+	} else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3445
+		$gd_page_id = geodir_login_page_id();
3446
+	} else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3447
+		$gd_page_id = geodir_payment_checkout_page_id();
3448
+	} else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3449
+		$gd_page_id = geodir_payment_invoices_page_id();
3450
+	}
3451
+
3452
+	if (!$gd_page_id > 0) {
3453
+		return;
3454
+	}
3455 3455
     
3456
-    $display = 'before';
3457
-    /**
3458
-     * Filter the position to display the page content.
3459
-     *
3460
-     * @since 1.6.3
3461
-     *
3462
-     * @param string $display Position to add the post content.
3463
-     * @param string $gd_page The geodirectory page type.
3464
-     */
3465
-    $display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3466
-
3467
-    if ($position !== $display) {
3468
-        return;
3469
-    }
3470
-
3471
-    $gd_post = $post;
3456
+	$display = 'before';
3457
+	/**
3458
+	 * Filter the position to display the page content.
3459
+	 *
3460
+	 * @since 1.6.3
3461
+	 *
3462
+	 * @param string $display Position to add the post content.
3463
+	 * @param string $gd_page The geodirectory page type.
3464
+	 */
3465
+	$display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3466
+
3467
+	if ($position !== $display) {
3468
+		return;
3469
+	}
3470
+
3471
+	$gd_post = $post;
3472 3472
     
3473
-    setup_postdata(get_post($gd_page_id));
3473
+	setup_postdata(get_post($gd_page_id));
3474 3474
 
3475
-    if (get_the_content()) {
3476
-        ?>
3475
+	if (get_the_content()) {
3476
+		?>
3477 3477
         <section class="entry-content clearfix" itemprop="articleBody"><?php the_content(); ?></section>
3478 3478
         <?php
3479
-    }
3479
+	}
3480 3480
 
3481
-    $post = $gd_post;
3482
-    if (!empty($gd_post) && is_object($gd_post)) {
3483
-        setup_postdata($gd_post);
3484
-    }
3481
+	$post = $gd_post;
3482
+	if (!empty($gd_post) && is_object($gd_post)) {
3483
+		setup_postdata($gd_post);
3484
+	}
3485 3485
 
3486 3486
 }
3487 3487
 add_action('geodir_add_page_content', 'geodir_add_page_content', 10, 2);
3488 3488
\ No newline at end of file
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.