Test Failed
Push — master ( a9f063...63f06b )
by Stiofan
19:08 queued 03:14
created
geodirectory-functions/custom_fields_predefined.php 3 patches
Indentation   +404 added lines, -404 removed lines patch added patch discarded remove patch
@@ -17,370 +17,370 @@  discard block
 block discarded – undo
17 17
  */
18 18
 function geodir_custom_fields_predefined($post_type=''){
19 19
 
20
-    $custom_fields = array();
21
-
22
-
23
-    // price
24
-    $custom_fields['price'] = array( // The key value should be unique and not contain any spaces.
25
-        'field_type'  =>  'text',
26
-        'class'       =>  'gd-price',
27
-        'icon'        =>  'fa fa-usd',
28
-        'name'        =>  __('Price', 'geodirectory'),
29
-        'description' =>  __('Adds a input for a price field. This will let you filter and sort by price.', 'geodirectory'),
30
-        'defaults'    => array(
31
-            'data_type'           =>  'FLOAT',
32
-            'decimal_point'       =>  '2',
33
-            'admin_title'         =>  'Price',
34
-            'site_title'          =>  'Price',
35
-            'admin_desc'          =>  'Enter the price in $ (no currency symbol)',
36
-            'htmlvar_name'        =>  'price',
37
-            'is_active'           =>  true,
38
-            'for_admin_use'       =>  false,
39
-            'default_value'       =>  '',
40
-            'show_in' 	      =>  '[detail],[listing]',
41
-            'is_required'         =>  false,
42
-            'validation_pattern'  =>  '\d+(\.\d{2})?',
43
-            'validation_msg'      =>  'Please enter number and decimal only ie: 100.50',
44
-            'required_msg'        =>  '',
45
-            'field_icon'          =>  'fa fa-usd',
46
-            'css_class'           =>  '',
47
-            'cat_sort'            =>  true,
48
-            'cat_filter'	      =>  true,
49
-            'extra_fields'        =>  array(
50
-                'is_price'                  =>  1,
51
-                'thousand_separator'        =>  'comma',
52
-                'decimal_separator'         =>  'period',
53
-                'decimal_display'           =>  'if',
54
-                'currency_symbol'           =>  '$',
55
-                'currency_symbol_placement' =>  'left'
56
-            )
57
-        )
58
-    );
59
-
60
-    // property status
61
-    $custom_fields['property_status'] = array( // The key value should be unique and not contain any spaces.
62
-        'field_type'  =>  'select',
63
-        'class'       =>  'gd-property-status',
64
-        'icon'        =>  'fa fa-home',
65
-        'name'        =>  __('Property Status', 'geodirectory'),
66
-        'description' =>  __('Adds a select input to be able to set the status of a property ie: For Sale, For Rent', 'geodirectory'),
67
-        'defaults'    => array(
68
-            'data_type'           =>  'VARCHAR',
69
-            'admin_title'         =>  'Property Status',
70
-            'site_title'          =>  'Property Status',
71
-            'admin_desc'          =>  'Enter the status of the property.',
72
-            'htmlvar_name'        =>  'property_status',
73
-            'is_active'           =>  true,
74
-            'for_admin_use'       =>  false,
75
-            'default_value'       =>  '',
76
-            'show_in' 	          =>  '[detail],[listing]',
77
-            'is_required'         =>  true,
78
-            'option_values'       =>  __('Select Status/,For Sale,For Rent,Sold,Let','geodirectory'),
79
-            'validation_pattern'  =>  '',
80
-            'validation_msg'      =>  '',
81
-            'required_msg'        =>  '',
82
-            'field_icon'          =>  'fa fa-home',
83
-            'css_class'           =>  '',
84
-            'cat_sort'            =>  true,
85
-            'cat_filter'	      =>  true
86
-        )
87
-    );
88
-
89
-    // property furnishing
90
-    $custom_fields['property_furnishing'] = array( // The key value should be unique and not contain any spaces.
91
-        'field_type'  =>  'select',
92
-        'class'       =>  'gd-property-furnishing',
93
-        'icon'        =>  'fa fa-home',
94
-        'name'        =>  __('Property Furnishing', 'geodirectory'),
95
-        'description' =>  __('Adds a select input to be able to set the furnishing status of a property ie: Unfurnished, Furnished', 'geodirectory'),
96
-        'defaults'    => array(
97
-            'data_type'           =>  'VARCHAR',
98
-            'admin_title'         =>  'Furnishing',
99
-            'site_title'          =>  'Furnishing',
100
-            'admin_desc'          =>  'Enter the furnishing status of the property.',
101
-            'htmlvar_name'        =>  'property_furnishing',
102
-            'is_active'           =>  true,
103
-            'for_admin_use'       =>  false,
104
-            'default_value'       =>  '',
105
-            'show_in' 	          =>  '[detail],[listing]',
106
-            'is_required'         =>  true,
107
-            'option_values'       =>  __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'),
108
-            'validation_pattern'  =>  '',
109
-            'validation_msg'      =>  '',
110
-            'required_msg'        =>  '',
111
-            'field_icon'          =>  'fa fa-th-large',
112
-            'css_class'           =>  '',
113
-            'cat_sort'            =>  true,
114
-            'cat_filter'	      =>  true
115
-        )
116
-    );
117
-
118
-    // property type
119
-    $custom_fields['property_type'] = array( // The key value should be unique and not contain any spaces.
120
-        'field_type'  =>  'select',
121
-        'class'       =>  'gd-property-type',
122
-        'icon'        =>  'fa fa-home',
123
-        'name'        =>  __('Property Type', 'geodirectory'),
124
-        'description' =>  __('Adds a select input for the property type ie: Detached house, Apartment', 'geodirectory'),
125
-        'defaults'    => array(
126
-            'data_type'           =>  'VARCHAR',
127
-            'admin_title'         =>  'Property Type',
128
-            'site_title'          =>  'Property Type',
129
-            'admin_desc'          =>  'Select the property type.',
130
-            'htmlvar_name'        =>  'property_type',
131
-            'is_active'           =>  true,
132
-            'for_admin_use'       =>  false,
133
-            'default_value'       =>  '',
134
-            'show_in' 	          =>  '[detail],[listing]',
135
-            'is_required'         =>  true,
136
-            'option_values'       =>  __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage','geodirectory'),
137
-            'validation_pattern'  =>  '',
138
-            'validation_msg'      =>  '',
139
-            'required_msg'        =>  '',
140
-            'field_icon'          =>  'fa fa-home',
141
-            'css_class'           =>  '',
142
-            'cat_sort'            =>  true,
143
-            'cat_filter'	      =>  true
144
-        )
145
-    );
146
-
147
-    // property bedrooms
148
-    $custom_fields['property_bedrooms'] = array( // The key value should be unique and not contain any spaces.
149
-        'field_type'  =>  'select',
150
-        'class'       =>  'gd-property-bedrooms',
151
-        'icon'        =>  'fa fa-home',
152
-        'name'        =>  __('Property Bedrooms', 'geodirectory'),
153
-        'description' =>  __('Adds a select input for the number of bedrooms.', 'geodirectory'),
154
-        'defaults'    => array(
155
-            'data_type'           =>  'VARCHAR',
156
-            'admin_title'         =>  'Property Bedrooms',
157
-            'site_title'          =>  'Bedrooms',
158
-            'admin_desc'          =>  'Select the number of bedrooms',
159
-            'htmlvar_name'        =>  'property_bedrooms',
160
-            'is_active'           =>  true,
161
-            'for_admin_use'       =>  false,
162
-            'default_value'       =>  '',
163
-            'show_in' 	          =>  '[detail],[listing]',
164
-            'is_required'         =>  true,
165
-            'option_values'       =>  __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
166
-            'validation_pattern'  =>  '',
167
-            'validation_msg'      =>  '',
168
-            'required_msg'        =>  '',
169
-            'field_icon'          =>  'fa fa-bed',
170
-            'css_class'           =>  '',
171
-            'cat_sort'            =>  true,
172
-            'cat_filter'	      =>  true
173
-        )
174
-    );
175
-
176
-    // property bathrooms
177
-    $custom_fields['property_bathrooms'] = array( // The key value should be unique and not contain any spaces.
178
-        'field_type'  =>  'select',
179
-        'class'       =>  'gd-property-bathrooms',
180
-        'icon'        =>  'fa fa-home',
181
-        'name'        =>  __('Property Bathrooms', 'geodirectory'),
182
-        'description' =>  __('Adds a select input for the number of bathrooms.', 'geodirectory'),
183
-        'defaults'    => array(
184
-            'data_type'           =>  'VARCHAR',
185
-            'admin_title'         =>  'Property Bathrooms',
186
-            'site_title'          =>  'Bathrooms',
187
-            'admin_desc'          =>  'Select the number of bathrooms',
188
-            'htmlvar_name'        =>  'property_bathrooms',
189
-            'is_active'           =>  true,
190
-            'for_admin_use'       =>  false,
191
-            'default_value'       =>  '',
192
-            'show_in' 	          =>  '[detail],[listing]',
193
-            'is_required'         =>  true,
194
-            'option_values'       =>  __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
195
-            'validation_pattern'  =>  '',
196
-            'validation_msg'      =>  '',
197
-            'required_msg'        =>  '',
198
-            'field_icon'          =>  'fa fa-bold',
199
-            'css_class'           =>  '',
200
-            'cat_sort'            =>  true,
201
-            'cat_filter'	      =>  true
202
-        )
203
-    );
204
-
205
-    // property area
206
-    $custom_fields['property_area'] = array( // The key value should be unique and not contain any spaces.
207
-        'field_type'  =>  'text',
208
-        'class'       =>  'gd-area',
209
-        'icon'        =>  'fa fa-home',
210
-        'name'        =>  __('Property Area', 'geodirectory'),
211
-        'description' =>  __('Adds a input for the property area.', 'geodirectory'),
212
-        'defaults'    => array(
213
-            'data_type'           =>  'FLOAT',
214
-            'admin_title'         =>  'Property Area',
215
-            'site_title'          =>  'Area (Sq Ft)',
216
-            'admin_desc'          =>  'Enter the Sq Ft value for the property',
217
-            'htmlvar_name'        =>  'property_area',
218
-            'is_active'           =>  true,
219
-            'for_admin_use'       =>  false,
220
-            'default_value'       =>  '',
221
-            'show_in' 	      =>  '[detail],[listing]',
222
-            'is_required'         =>  false,
223
-            'validation_pattern'  =>  '\d+(\.\d{2})?',
224
-            'validation_msg'      =>  'Please enter the property area in numbers only: 1500',
225
-            'required_msg'        =>  '',
226
-            'field_icon'          =>  'fa fa-area-chart',
227
-            'css_class'           =>  '',
228
-            'cat_sort'            =>  true,
229
-            'cat_filter'	      =>  true
230
-        )
231
-    );
232
-
233
-    // property features
234
-    $custom_fields['property_features'] = array( // The key value should be unique and not contain any spaces.
235
-        'field_type'  =>  'multiselect',
236
-        'class'       =>  'gd-property-features',
237
-        'icon'        =>  'fa fa-home',
238
-        'name'        =>  __('Property Features', 'geodirectory'),
239
-        'description' =>  __('Adds a select input for the property features.', 'geodirectory'),
240
-        'defaults'    => array(
241
-            'data_type'           =>  'VARCHAR',
242
-            'admin_title'         =>  'Property Features',
243
-            'site_title'          =>  'Features',
244
-            'admin_desc'          =>  'Select the property features.',
245
-            'htmlvar_name'        =>  'property_features',
246
-            'is_active'           =>  true,
247
-            'for_admin_use'       =>  false,
248
-            'default_value'       =>  '',
249
-            'show_in' 	          =>  '[detail],[listing]',
250
-            'is_required'         =>  true,
251
-            'option_values'       =>  __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'),
252
-            'validation_pattern'  =>  '',
253
-            'validation_msg'      =>  '',
254
-            'required_msg'        =>  '',
255
-            'field_icon'          =>  'fa fa-plus-square',
256
-            'css_class'           =>  '',
257
-            'cat_sort'            =>  true,
258
-            'cat_filter'	      =>  true
259
-        )
260
-    );
261
-
262
-    // Twitter feed
263
-    $custom_fields['twitter_feed'] = array( // The key value should be unique and not contain any spaces.
264
-        'field_type'  =>  'text',
265
-        'class'       =>  'gd-twitter',
266
-        'icon'        =>  'fa fa-twitter',
267
-        'name'        =>  __('Twitter feed', 'geodirectory'),
268
-        'description' =>  __('Adds a input for twitter username and outputs feed.', 'geodirectory'),
269
-        'defaults'    => array(
270
-            'data_type'           =>  'VARCHAR',
271
-            'admin_title'         =>  'Twitter',
272
-            'site_title'          =>  'Twitter',
273
-            'admin_desc'          =>  'Enter your Twitter username',
274
-            'htmlvar_name'        =>  'twitterusername',
275
-            'is_active'           =>  true,
276
-            'for_admin_use'       =>  false,
277
-            'default_value'       =>  '',
278
-            'show_in' 	      =>  '[detail],[owntab]',
279
-            'is_required'         =>  false,
280
-            'validation_pattern'  =>  '^[A-Za-z0-9_]{1,32}$',
281
-            'validation_msg'      =>  'Please enter a valid twitter username.',
282
-            'required_msg'        =>  '',
283
-            'field_icon'          =>  'fa fa-twitter',
284
-            'css_class'           =>  '',
285
-            'cat_sort'            =>  false,
286
-            'cat_filter'	      =>  false
287
-        )
288
-    );
289
-
290
-    // Get directions link
291
-    $custom_fields['get_directions'] = array( // The key value should be unique and not contain any spaces.
292
-        'field_type'  =>  'text',
293
-        'class'       =>  'gd-get-directions',
294
-        'icon'        =>  'fa fa-location-arrow',
295
-        'name'        =>  __('Get Directions Link', 'geodirectory'),
296
-        'description' =>  __('Adds a input for twitter username and outputs feed.', 'geodirectory'),
297
-        'defaults'    => array(
298
-            'data_type'           =>  'VARCHAR',
299
-            'admin_title'         =>  'Get Directions',
300
-            'site_title'          =>  'Get Directions',
301
-            'admin_desc'          =>  '',
302
-            'htmlvar_name'        =>  'get_directions',
303
-            'is_active'           =>  true,
304
-            'for_admin_use'       =>  true,
305
-            'default_value'       =>  'Get Directions',
306
-            'show_in' 	      =>  '[detail],[listing]',
307
-            'is_required'         =>  false,
308
-            'validation_pattern'  =>  '',
309
-            'validation_msg'      =>  '',
310
-            'required_msg'        =>  '',
311
-            'field_icon'          =>  'fa fa-location-arrow',
312
-            'css_class'           =>  '',
313
-            'cat_sort'            =>  false,
314
-            'cat_filter'	      =>  false
315
-        )
316
-    );
317
-
318
-
319
-    // JOB TYPE CF
320
-
321
-    // job type
322
-    $custom_fields['job_type'] = array( // The key value should be unique and not contain any spaces.
323
-        'field_type'  =>  'select',
324
-        'class'       =>  'gd-job-type',
325
-        'icon'        =>  'fa fa-briefcase',
326
-        'name'        =>  __('Job Type', 'geodirectory'),
327
-        'description' =>  __('Adds a select input to be able to set the type of a job ie: Full Time, Part Time', 'geodirectory'),
328
-        'defaults'    => array(
329
-            'data_type'           =>  'VARCHAR',
330
-            'admin_title'         =>  __('Job Type', 'geodirectory'),
331
-            'site_title'          =>  __('Job Type','geodirectory'),
332
-            'admin_desc'          =>  __('Select the type of job.','geodirectory'),
333
-            'htmlvar_name'        =>  'job_type',
334
-            'is_active'           =>  true,
335
-            'for_admin_use'       =>  false,
336
-            'default_value'       =>  '',
337
-            'show_in' 	          =>  '[detail],[listing]',
338
-            'is_required'         =>  true,
339
-            'option_values'       =>  __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other','geodirectory'),
340
-            'validation_pattern'  =>  '',
341
-            'validation_msg'      =>  '',
342
-            'required_msg'        =>  '',
343
-            'field_icon'          =>  'fa fa-briefcase',
344
-            'css_class'           =>  '',
345
-            'cat_sort'            =>  true,
346
-            'cat_filter'	      =>  true
347
-        )
348
-    );
349
-
350
-    // job sector
351
-    $custom_fields['job_sector'] = array( // The key value should be unique and not contain any spaces.
352
-        'field_type'  =>  'select',
353
-        'class'       =>  'gd-job-type',
354
-        'icon'        =>  'fa fa-briefcase',
355
-        'name'        =>  __('Job Sector', 'geodirectory'),
356
-        'description' =>  __('Adds a select input to be able to set the type of a job Sector ie: Private Sector,Public Sector', 'geodirectory'),
357
-        'defaults'    => array(
358
-            'data_type'           =>  'VARCHAR',
359
-            'admin_title'         =>  __('Job Sector','geodirectory'),
360
-            'site_title'          =>  __('Job Sector','geodirectory'),
361
-            'admin_desc'          =>  __('Select the job sector.','geodirectory'),
362
-            'htmlvar_name'        =>  'job_sector',
363
-            'is_active'           =>  true,
364
-            'for_admin_use'       =>  false,
365
-            'default_value'       =>  '',
366
-            'show_in' 	          =>  '[detail]',
367
-            'is_required'         =>  true,
368
-            'option_values'       =>  __('Select Sector/,Private Sector,Public Sector,Agencies','geodirectory'),
369
-            'validation_pattern'  =>  '',
370
-            'validation_msg'      =>  '',
371
-            'required_msg'        =>  '',
372
-            'field_icon'          =>  'fa fa-briefcase',
373
-            'css_class'           =>  '',
374
-            'cat_sort'            =>  true,
375
-            'cat_filter'	      =>  true
376
-        )
377
-    );
378
-
379
-
380
-    /**
381
-     * @see `geodir_custom_fields`
382
-     */
383
-    return apply_filters('geodir_custom_fields_predefined',$custom_fields,$post_type);
20
+	$custom_fields = array();
21
+
22
+
23
+	// price
24
+	$custom_fields['price'] = array( // The key value should be unique and not contain any spaces.
25
+		'field_type'  =>  'text',
26
+		'class'       =>  'gd-price',
27
+		'icon'        =>  'fa fa-usd',
28
+		'name'        =>  __('Price', 'geodirectory'),
29
+		'description' =>  __('Adds a input for a price field. This will let you filter and sort by price.', 'geodirectory'),
30
+		'defaults'    => array(
31
+			'data_type'           =>  'FLOAT',
32
+			'decimal_point'       =>  '2',
33
+			'admin_title'         =>  'Price',
34
+			'site_title'          =>  'Price',
35
+			'admin_desc'          =>  'Enter the price in $ (no currency symbol)',
36
+			'htmlvar_name'        =>  'price',
37
+			'is_active'           =>  true,
38
+			'for_admin_use'       =>  false,
39
+			'default_value'       =>  '',
40
+			'show_in' 	      =>  '[detail],[listing]',
41
+			'is_required'         =>  false,
42
+			'validation_pattern'  =>  '\d+(\.\d{2})?',
43
+			'validation_msg'      =>  'Please enter number and decimal only ie: 100.50',
44
+			'required_msg'        =>  '',
45
+			'field_icon'          =>  'fa fa-usd',
46
+			'css_class'           =>  '',
47
+			'cat_sort'            =>  true,
48
+			'cat_filter'	      =>  true,
49
+			'extra_fields'        =>  array(
50
+				'is_price'                  =>  1,
51
+				'thousand_separator'        =>  'comma',
52
+				'decimal_separator'         =>  'period',
53
+				'decimal_display'           =>  'if',
54
+				'currency_symbol'           =>  '$',
55
+				'currency_symbol_placement' =>  'left'
56
+			)
57
+		)
58
+	);
59
+
60
+	// property status
61
+	$custom_fields['property_status'] = array( // The key value should be unique and not contain any spaces.
62
+		'field_type'  =>  'select',
63
+		'class'       =>  'gd-property-status',
64
+		'icon'        =>  'fa fa-home',
65
+		'name'        =>  __('Property Status', 'geodirectory'),
66
+		'description' =>  __('Adds a select input to be able to set the status of a property ie: For Sale, For Rent', 'geodirectory'),
67
+		'defaults'    => array(
68
+			'data_type'           =>  'VARCHAR',
69
+			'admin_title'         =>  'Property Status',
70
+			'site_title'          =>  'Property Status',
71
+			'admin_desc'          =>  'Enter the status of the property.',
72
+			'htmlvar_name'        =>  'property_status',
73
+			'is_active'           =>  true,
74
+			'for_admin_use'       =>  false,
75
+			'default_value'       =>  '',
76
+			'show_in' 	          =>  '[detail],[listing]',
77
+			'is_required'         =>  true,
78
+			'option_values'       =>  __('Select Status/,For Sale,For Rent,Sold,Let','geodirectory'),
79
+			'validation_pattern'  =>  '',
80
+			'validation_msg'      =>  '',
81
+			'required_msg'        =>  '',
82
+			'field_icon'          =>  'fa fa-home',
83
+			'css_class'           =>  '',
84
+			'cat_sort'            =>  true,
85
+			'cat_filter'	      =>  true
86
+		)
87
+	);
88
+
89
+	// property furnishing
90
+	$custom_fields['property_furnishing'] = array( // The key value should be unique and not contain any spaces.
91
+		'field_type'  =>  'select',
92
+		'class'       =>  'gd-property-furnishing',
93
+		'icon'        =>  'fa fa-home',
94
+		'name'        =>  __('Property Furnishing', 'geodirectory'),
95
+		'description' =>  __('Adds a select input to be able to set the furnishing status of a property ie: Unfurnished, Furnished', 'geodirectory'),
96
+		'defaults'    => array(
97
+			'data_type'           =>  'VARCHAR',
98
+			'admin_title'         =>  'Furnishing',
99
+			'site_title'          =>  'Furnishing',
100
+			'admin_desc'          =>  'Enter the furnishing status of the property.',
101
+			'htmlvar_name'        =>  'property_furnishing',
102
+			'is_active'           =>  true,
103
+			'for_admin_use'       =>  false,
104
+			'default_value'       =>  '',
105
+			'show_in' 	          =>  '[detail],[listing]',
106
+			'is_required'         =>  true,
107
+			'option_values'       =>  __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'),
108
+			'validation_pattern'  =>  '',
109
+			'validation_msg'      =>  '',
110
+			'required_msg'        =>  '',
111
+			'field_icon'          =>  'fa fa-th-large',
112
+			'css_class'           =>  '',
113
+			'cat_sort'            =>  true,
114
+			'cat_filter'	      =>  true
115
+		)
116
+	);
117
+
118
+	// property type
119
+	$custom_fields['property_type'] = array( // The key value should be unique and not contain any spaces.
120
+		'field_type'  =>  'select',
121
+		'class'       =>  'gd-property-type',
122
+		'icon'        =>  'fa fa-home',
123
+		'name'        =>  __('Property Type', 'geodirectory'),
124
+		'description' =>  __('Adds a select input for the property type ie: Detached house, Apartment', 'geodirectory'),
125
+		'defaults'    => array(
126
+			'data_type'           =>  'VARCHAR',
127
+			'admin_title'         =>  'Property Type',
128
+			'site_title'          =>  'Property Type',
129
+			'admin_desc'          =>  'Select the property type.',
130
+			'htmlvar_name'        =>  'property_type',
131
+			'is_active'           =>  true,
132
+			'for_admin_use'       =>  false,
133
+			'default_value'       =>  '',
134
+			'show_in' 	          =>  '[detail],[listing]',
135
+			'is_required'         =>  true,
136
+			'option_values'       =>  __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage','geodirectory'),
137
+			'validation_pattern'  =>  '',
138
+			'validation_msg'      =>  '',
139
+			'required_msg'        =>  '',
140
+			'field_icon'          =>  'fa fa-home',
141
+			'css_class'           =>  '',
142
+			'cat_sort'            =>  true,
143
+			'cat_filter'	      =>  true
144
+		)
145
+	);
146
+
147
+	// property bedrooms
148
+	$custom_fields['property_bedrooms'] = array( // The key value should be unique and not contain any spaces.
149
+		'field_type'  =>  'select',
150
+		'class'       =>  'gd-property-bedrooms',
151
+		'icon'        =>  'fa fa-home',
152
+		'name'        =>  __('Property Bedrooms', 'geodirectory'),
153
+		'description' =>  __('Adds a select input for the number of bedrooms.', 'geodirectory'),
154
+		'defaults'    => array(
155
+			'data_type'           =>  'VARCHAR',
156
+			'admin_title'         =>  'Property Bedrooms',
157
+			'site_title'          =>  'Bedrooms',
158
+			'admin_desc'          =>  'Select the number of bedrooms',
159
+			'htmlvar_name'        =>  'property_bedrooms',
160
+			'is_active'           =>  true,
161
+			'for_admin_use'       =>  false,
162
+			'default_value'       =>  '',
163
+			'show_in' 	          =>  '[detail],[listing]',
164
+			'is_required'         =>  true,
165
+			'option_values'       =>  __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
166
+			'validation_pattern'  =>  '',
167
+			'validation_msg'      =>  '',
168
+			'required_msg'        =>  '',
169
+			'field_icon'          =>  'fa fa-bed',
170
+			'css_class'           =>  '',
171
+			'cat_sort'            =>  true,
172
+			'cat_filter'	      =>  true
173
+		)
174
+	);
175
+
176
+	// property bathrooms
177
+	$custom_fields['property_bathrooms'] = array( // The key value should be unique and not contain any spaces.
178
+		'field_type'  =>  'select',
179
+		'class'       =>  'gd-property-bathrooms',
180
+		'icon'        =>  'fa fa-home',
181
+		'name'        =>  __('Property Bathrooms', 'geodirectory'),
182
+		'description' =>  __('Adds a select input for the number of bathrooms.', 'geodirectory'),
183
+		'defaults'    => array(
184
+			'data_type'           =>  'VARCHAR',
185
+			'admin_title'         =>  'Property Bathrooms',
186
+			'site_title'          =>  'Bathrooms',
187
+			'admin_desc'          =>  'Select the number of bathrooms',
188
+			'htmlvar_name'        =>  'property_bathrooms',
189
+			'is_active'           =>  true,
190
+			'for_admin_use'       =>  false,
191
+			'default_value'       =>  '',
192
+			'show_in' 	          =>  '[detail],[listing]',
193
+			'is_required'         =>  true,
194
+			'option_values'       =>  __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
195
+			'validation_pattern'  =>  '',
196
+			'validation_msg'      =>  '',
197
+			'required_msg'        =>  '',
198
+			'field_icon'          =>  'fa fa-bold',
199
+			'css_class'           =>  '',
200
+			'cat_sort'            =>  true,
201
+			'cat_filter'	      =>  true
202
+		)
203
+	);
204
+
205
+	// property area
206
+	$custom_fields['property_area'] = array( // The key value should be unique and not contain any spaces.
207
+		'field_type'  =>  'text',
208
+		'class'       =>  'gd-area',
209
+		'icon'        =>  'fa fa-home',
210
+		'name'        =>  __('Property Area', 'geodirectory'),
211
+		'description' =>  __('Adds a input for the property area.', 'geodirectory'),
212
+		'defaults'    => array(
213
+			'data_type'           =>  'FLOAT',
214
+			'admin_title'         =>  'Property Area',
215
+			'site_title'          =>  'Area (Sq Ft)',
216
+			'admin_desc'          =>  'Enter the Sq Ft value for the property',
217
+			'htmlvar_name'        =>  'property_area',
218
+			'is_active'           =>  true,
219
+			'for_admin_use'       =>  false,
220
+			'default_value'       =>  '',
221
+			'show_in' 	      =>  '[detail],[listing]',
222
+			'is_required'         =>  false,
223
+			'validation_pattern'  =>  '\d+(\.\d{2})?',
224
+			'validation_msg'      =>  'Please enter the property area in numbers only: 1500',
225
+			'required_msg'        =>  '',
226
+			'field_icon'          =>  'fa fa-area-chart',
227
+			'css_class'           =>  '',
228
+			'cat_sort'            =>  true,
229
+			'cat_filter'	      =>  true
230
+		)
231
+	);
232
+
233
+	// property features
234
+	$custom_fields['property_features'] = array( // The key value should be unique and not contain any spaces.
235
+		'field_type'  =>  'multiselect',
236
+		'class'       =>  'gd-property-features',
237
+		'icon'        =>  'fa fa-home',
238
+		'name'        =>  __('Property Features', 'geodirectory'),
239
+		'description' =>  __('Adds a select input for the property features.', 'geodirectory'),
240
+		'defaults'    => array(
241
+			'data_type'           =>  'VARCHAR',
242
+			'admin_title'         =>  'Property Features',
243
+			'site_title'          =>  'Features',
244
+			'admin_desc'          =>  'Select the property features.',
245
+			'htmlvar_name'        =>  'property_features',
246
+			'is_active'           =>  true,
247
+			'for_admin_use'       =>  false,
248
+			'default_value'       =>  '',
249
+			'show_in' 	          =>  '[detail],[listing]',
250
+			'is_required'         =>  true,
251
+			'option_values'       =>  __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'),
252
+			'validation_pattern'  =>  '',
253
+			'validation_msg'      =>  '',
254
+			'required_msg'        =>  '',
255
+			'field_icon'          =>  'fa fa-plus-square',
256
+			'css_class'           =>  '',
257
+			'cat_sort'            =>  true,
258
+			'cat_filter'	      =>  true
259
+		)
260
+	);
261
+
262
+	// Twitter feed
263
+	$custom_fields['twitter_feed'] = array( // The key value should be unique and not contain any spaces.
264
+		'field_type'  =>  'text',
265
+		'class'       =>  'gd-twitter',
266
+		'icon'        =>  'fa fa-twitter',
267
+		'name'        =>  __('Twitter feed', 'geodirectory'),
268
+		'description' =>  __('Adds a input for twitter username and outputs feed.', 'geodirectory'),
269
+		'defaults'    => array(
270
+			'data_type'           =>  'VARCHAR',
271
+			'admin_title'         =>  'Twitter',
272
+			'site_title'          =>  'Twitter',
273
+			'admin_desc'          =>  'Enter your Twitter username',
274
+			'htmlvar_name'        =>  'twitterusername',
275
+			'is_active'           =>  true,
276
+			'for_admin_use'       =>  false,
277
+			'default_value'       =>  '',
278
+			'show_in' 	      =>  '[detail],[owntab]',
279
+			'is_required'         =>  false,
280
+			'validation_pattern'  =>  '^[A-Za-z0-9_]{1,32}$',
281
+			'validation_msg'      =>  'Please enter a valid twitter username.',
282
+			'required_msg'        =>  '',
283
+			'field_icon'          =>  'fa fa-twitter',
284
+			'css_class'           =>  '',
285
+			'cat_sort'            =>  false,
286
+			'cat_filter'	      =>  false
287
+		)
288
+	);
289
+
290
+	// Get directions link
291
+	$custom_fields['get_directions'] = array( // The key value should be unique and not contain any spaces.
292
+		'field_type'  =>  'text',
293
+		'class'       =>  'gd-get-directions',
294
+		'icon'        =>  'fa fa-location-arrow',
295
+		'name'        =>  __('Get Directions Link', 'geodirectory'),
296
+		'description' =>  __('Adds a input for twitter username and outputs feed.', 'geodirectory'),
297
+		'defaults'    => array(
298
+			'data_type'           =>  'VARCHAR',
299
+			'admin_title'         =>  'Get Directions',
300
+			'site_title'          =>  'Get Directions',
301
+			'admin_desc'          =>  '',
302
+			'htmlvar_name'        =>  'get_directions',
303
+			'is_active'           =>  true,
304
+			'for_admin_use'       =>  true,
305
+			'default_value'       =>  'Get Directions',
306
+			'show_in' 	      =>  '[detail],[listing]',
307
+			'is_required'         =>  false,
308
+			'validation_pattern'  =>  '',
309
+			'validation_msg'      =>  '',
310
+			'required_msg'        =>  '',
311
+			'field_icon'          =>  'fa fa-location-arrow',
312
+			'css_class'           =>  '',
313
+			'cat_sort'            =>  false,
314
+			'cat_filter'	      =>  false
315
+		)
316
+	);
317
+
318
+
319
+	// JOB TYPE CF
320
+
321
+	// job type
322
+	$custom_fields['job_type'] = array( // The key value should be unique and not contain any spaces.
323
+		'field_type'  =>  'select',
324
+		'class'       =>  'gd-job-type',
325
+		'icon'        =>  'fa fa-briefcase',
326
+		'name'        =>  __('Job Type', 'geodirectory'),
327
+		'description' =>  __('Adds a select input to be able to set the type of a job ie: Full Time, Part Time', 'geodirectory'),
328
+		'defaults'    => array(
329
+			'data_type'           =>  'VARCHAR',
330
+			'admin_title'         =>  __('Job Type', 'geodirectory'),
331
+			'site_title'          =>  __('Job Type','geodirectory'),
332
+			'admin_desc'          =>  __('Select the type of job.','geodirectory'),
333
+			'htmlvar_name'        =>  'job_type',
334
+			'is_active'           =>  true,
335
+			'for_admin_use'       =>  false,
336
+			'default_value'       =>  '',
337
+			'show_in' 	          =>  '[detail],[listing]',
338
+			'is_required'         =>  true,
339
+			'option_values'       =>  __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other','geodirectory'),
340
+			'validation_pattern'  =>  '',
341
+			'validation_msg'      =>  '',
342
+			'required_msg'        =>  '',
343
+			'field_icon'          =>  'fa fa-briefcase',
344
+			'css_class'           =>  '',
345
+			'cat_sort'            =>  true,
346
+			'cat_filter'	      =>  true
347
+		)
348
+	);
349
+
350
+	// job sector
351
+	$custom_fields['job_sector'] = array( // The key value should be unique and not contain any spaces.
352
+		'field_type'  =>  'select',
353
+		'class'       =>  'gd-job-type',
354
+		'icon'        =>  'fa fa-briefcase',
355
+		'name'        =>  __('Job Sector', 'geodirectory'),
356
+		'description' =>  __('Adds a select input to be able to set the type of a job Sector ie: Private Sector,Public Sector', 'geodirectory'),
357
+		'defaults'    => array(
358
+			'data_type'           =>  'VARCHAR',
359
+			'admin_title'         =>  __('Job Sector','geodirectory'),
360
+			'site_title'          =>  __('Job Sector','geodirectory'),
361
+			'admin_desc'          =>  __('Select the job sector.','geodirectory'),
362
+			'htmlvar_name'        =>  'job_sector',
363
+			'is_active'           =>  true,
364
+			'for_admin_use'       =>  false,
365
+			'default_value'       =>  '',
366
+			'show_in' 	          =>  '[detail]',
367
+			'is_required'         =>  true,
368
+			'option_values'       =>  __('Select Sector/,Private Sector,Public Sector,Agencies','geodirectory'),
369
+			'validation_pattern'  =>  '',
370
+			'validation_msg'      =>  '',
371
+			'required_msg'        =>  '',
372
+			'field_icon'          =>  'fa fa-briefcase',
373
+			'css_class'           =>  '',
374
+			'cat_sort'            =>  true,
375
+			'cat_filter'	      =>  true
376
+		)
377
+	);
378
+
379
+
380
+	/**
381
+	 * @see `geodir_custom_fields`
382
+	 */
383
+	return apply_filters('geodir_custom_fields_predefined',$custom_fields,$post_type);
384 384
 }
385 385
 
386 386
 
@@ -395,32 +395,32 @@  discard block
 block discarded – undo
395 395
  * @return string The html to output.
396 396
  */
397 397
 function geodir_predefined_custom_field_output_twitter_feed($html,$location,$cf){
398
-    global $post;
398
+	global $post;
399 399
 
400 400
 
401
-    if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ):
401
+	if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ):
402 402
 
403
-        $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text";
403
+		$class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text";
404 404
 
405
-        $field_icon = geodir_field_icon_proccess($cf);
406
-        if (strpos($field_icon, 'http') !== false) {
407
-            $field_icon_af = '';
408
-        } elseif ($field_icon == '') {
409
-            $field_icon_af = ($cf['htmlvar_name'] == 'geodir_timing') ? '<i class="fa fa-clock-o"></i>' : "";
410
-        } else {
411
-            $field_icon_af = $field_icon;
412
-            $field_icon = '';
413
-        }
405
+		$field_icon = geodir_field_icon_proccess($cf);
406
+		if (strpos($field_icon, 'http') !== false) {
407
+			$field_icon_af = '';
408
+		} elseif ($field_icon == '') {
409
+			$field_icon_af = ($cf['htmlvar_name'] == 'geodir_timing') ? '<i class="fa fa-clock-o"></i>' : "";
410
+		} else {
411
+			$field_icon_af = $field_icon;
412
+			$field_icon = '';
413
+		}
414 414
 
415 415
 
416
-        $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">';
416
+		$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">';
417 417
 
418
-        $html .= '<a class="twitter-timeline" data-height="600" data-dnt="true" href="https://twitter.com/'.$post->{$cf['htmlvar_name']}.'">Tweets by '.$post->{$cf['htmlvar_name']}.'</a> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>';
419
-        $html .= '</div>';
418
+		$html .= '<a class="twitter-timeline" data-height="600" data-dnt="true" href="https://twitter.com/'.$post->{$cf['htmlvar_name']}.'">Tweets by '.$post->{$cf['htmlvar_name']}.'</a> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>';
419
+		$html .= '</div>';
420 420
 
421
-    endif;
421
+	endif;
422 422
 
423
-    return $html;
423
+	return $html;
424 424
 }
425 425
 add_filter('geodir_custom_field_output_text_key_twitter_feed','geodir_predefined_custom_field_output_twitter_feed',10,3);
426 426
 
@@ -435,37 +435,37 @@  discard block
 block discarded – undo
435 435
  * @return string The html to output.
436 436
  */
437 437
 function geodir_predefined_custom_field_output_get_directions($html,$location,$cf) {
438
-    global $post;
438
+	global $post;
439 439
 
440 440
 
441
-    if ( isset( $post->{$cf['htmlvar_name']} ) && $post->{$cf['htmlvar_name']} != '' && isset( $post->post_latitude ) && $post->post_latitude ){
441
+	if ( isset( $post->{$cf['htmlvar_name']} ) && $post->{$cf['htmlvar_name']} != '' && isset( $post->post_latitude ) && $post->post_latitude ){
442 442
 
443
-        $field_icon = geodir_field_icon_proccess( $cf );
444
-        if ( strpos( $field_icon, 'http' ) !== false ) {
445
-            $field_icon_af = '';
446
-        } elseif ( $field_icon == '' ) {
447
-            $field_icon_af = '<i class="fa fa-location-arrow"></i>';
448
-        } else {
449
-            $field_icon_af = $field_icon;
450
-            $field_icon    = '';
451
-        }
443
+		$field_icon = geodir_field_icon_proccess( $cf );
444
+		if ( strpos( $field_icon, 'http' ) !== false ) {
445
+			$field_icon_af = '';
446
+		} elseif ( $field_icon == '' ) {
447
+			$field_icon_af = '<i class="fa fa-location-arrow"></i>';
448
+		} else {
449
+			$field_icon_af = $field_icon;
450
+			$field_icon    = '';
451
+		}
452 452
 
453
-        $link_text = isset( $post->{$cf['default_value']} ) ? $post->{$cf['default_value']} : __( 'Get Directions', 'geodirectory' );
453
+		$link_text = isset( $post->{$cf['default_value']} ) ? $post->{$cf['default_value']} : __( 'Get Directions', 'geodirectory' );
454 454
 
455
-        $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">';
455
+		$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">';
456 456
 
457
-        if(isset( $cf['field_icon'] ) && $cf['field_icon']){
458
-            $html .= $field_icon_af;
459
-        }
457
+		if(isset( $cf['field_icon'] ) && $cf['field_icon']){
458
+			$html .= $field_icon_af;
459
+		}
460 460
 
461
-        // We use maps.apple.com here because it will handle redirects nicely in most cases
462
-        $html .= '<a href="https://maps.apple.com/?daddr=' . $post->post_latitude . ',' . $post->post_longitude . '" target="_blank" >' . $link_text . '</a>';
463
-        $html .= '</div>';
461
+		// We use maps.apple.com here because it will handle redirects nicely in most cases
462
+		$html .= '<a href="https://maps.apple.com/?daddr=' . $post->post_latitude . ',' . $post->post_longitude . '" target="_blank" >' . $link_text . '</a>';
463
+		$html .= '</div>';
464 464
 
465
-    }else{
466
-        $html ='';
467
-    }
465
+	}else{
466
+		$html ='';
467
+	}
468 468
 
469
-    return $html;
469
+	return $html;
470 470
 }
471 471
 add_filter('geodir_custom_field_output_text_key_get_directions','geodir_predefined_custom_field_output_get_directions',10,3);
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
  * @package GeoDirectory
16 16
  * @see `geodir_custom_field_save` for array details.
17 17
  */
18
-function geodir_custom_fields_predefined($post_type=''){
18
+function geodir_custom_fields_predefined($post_type = '') {
19 19
 
20 20
     $custom_fields = array();
21 21
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
             'default_value'       =>  '',
76 76
             'show_in' 	          =>  '[detail],[listing]',
77 77
             'is_required'         =>  true,
78
-            'option_values'       =>  __('Select Status/,For Sale,For Rent,Sold,Let','geodirectory'),
78
+            'option_values'       =>  __('Select Status/,For Sale,For Rent,Sold,Let', 'geodirectory'),
79 79
             'validation_pattern'  =>  '',
80 80
             'validation_msg'      =>  '',
81 81
             'required_msg'        =>  '',
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             'default_value'       =>  '',
105 105
             'show_in' 	          =>  '[detail],[listing]',
106 106
             'is_required'         =>  true,
107
-            'option_values'       =>  __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'),
107
+            'option_values'       =>  __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional', 'geodirectory'),
108 108
             'validation_pattern'  =>  '',
109 109
             'validation_msg'      =>  '',
110 110
             'required_msg'        =>  '',
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
             'default_value'       =>  '',
134 134
             'show_in' 	          =>  '[detail],[listing]',
135 135
             'is_required'         =>  true,
136
-            'option_values'       =>  __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage','geodirectory'),
136
+            'option_values'       =>  __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage', 'geodirectory'),
137 137
             'validation_pattern'  =>  '',
138 138
             'validation_msg'      =>  '',
139 139
             'required_msg'        =>  '',
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
             'default_value'       =>  '',
163 163
             'show_in' 	          =>  '[detail],[listing]',
164 164
             'is_required'         =>  true,
165
-            'option_values'       =>  __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
165
+            'option_values'       =>  __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10', 'geodirectory'),
166 166
             'validation_pattern'  =>  '',
167 167
             'validation_msg'      =>  '',
168 168
             'required_msg'        =>  '',
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
             'default_value'       =>  '',
192 192
             'show_in' 	          =>  '[detail],[listing]',
193 193
             'is_required'         =>  true,
194
-            'option_values'       =>  __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
194
+            'option_values'       =>  __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10', 'geodirectory'),
195 195
             'validation_pattern'  =>  '',
196 196
             'validation_msg'      =>  '',
197 197
             'required_msg'        =>  '',
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
             'default_value'       =>  '',
249 249
             'show_in' 	          =>  '[detail],[listing]',
250 250
             'is_required'         =>  true,
251
-            'option_values'       =>  __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'),
251
+            'option_values'       =>  __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace', 'geodirectory'),
252 252
             'validation_pattern'  =>  '',
253 253
             'validation_msg'      =>  '',
254 254
             'required_msg'        =>  '',
@@ -328,15 +328,15 @@  discard block
 block discarded – undo
328 328
         'defaults'    => array(
329 329
             'data_type'           =>  'VARCHAR',
330 330
             'admin_title'         =>  __('Job Type', 'geodirectory'),
331
-            'site_title'          =>  __('Job Type','geodirectory'),
332
-            'admin_desc'          =>  __('Select the type of job.','geodirectory'),
331
+            'site_title'          =>  __('Job Type', 'geodirectory'),
332
+            'admin_desc'          =>  __('Select the type of job.', 'geodirectory'),
333 333
             'htmlvar_name'        =>  'job_type',
334 334
             'is_active'           =>  true,
335 335
             'for_admin_use'       =>  false,
336 336
             'default_value'       =>  '',
337 337
             'show_in' 	          =>  '[detail],[listing]',
338 338
             'is_required'         =>  true,
339
-            'option_values'       =>  __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other','geodirectory'),
339
+            'option_values'       =>  __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other', 'geodirectory'),
340 340
             'validation_pattern'  =>  '',
341 341
             'validation_msg'      =>  '',
342 342
             'required_msg'        =>  '',
@@ -356,16 +356,16 @@  discard block
 block discarded – undo
356 356
         'description' =>  __('Adds a select input to be able to set the type of a job Sector ie: Private Sector,Public Sector', 'geodirectory'),
357 357
         'defaults'    => array(
358 358
             'data_type'           =>  'VARCHAR',
359
-            'admin_title'         =>  __('Job Sector','geodirectory'),
360
-            'site_title'          =>  __('Job Sector','geodirectory'),
361
-            'admin_desc'          =>  __('Select the job sector.','geodirectory'),
359
+            'admin_title'         =>  __('Job Sector', 'geodirectory'),
360
+            'site_title'          =>  __('Job Sector', 'geodirectory'),
361
+            'admin_desc'          =>  __('Select the job sector.', 'geodirectory'),
362 362
             'htmlvar_name'        =>  'job_sector',
363 363
             'is_active'           =>  true,
364 364
             'for_admin_use'       =>  false,
365 365
             'default_value'       =>  '',
366 366
             'show_in' 	          =>  '[detail]',
367 367
             'is_required'         =>  true,
368
-            'option_values'       =>  __('Select Sector/,Private Sector,Public Sector,Agencies','geodirectory'),
368
+            'option_values'       =>  __('Select Sector/,Private Sector,Public Sector,Agencies', 'geodirectory'),
369 369
             'validation_pattern'  =>  '',
370 370
             'validation_msg'      =>  '',
371 371
             'required_msg'        =>  '',
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
     /**
381 381
      * @see `geodir_custom_fields`
382 382
      */
383
-    return apply_filters('geodir_custom_fields_predefined',$custom_fields,$post_type);
383
+    return apply_filters('geodir_custom_fields_predefined', $custom_fields, $post_type);
384 384
 }
385 385
 
386 386
 
@@ -394,11 +394,11 @@  discard block
 block discarded – undo
394 394
  * @since 1.6.9
395 395
  * @return string The html to output.
396 396
  */
397
-function geodir_predefined_custom_field_output_twitter_feed($html,$location,$cf){
397
+function geodir_predefined_custom_field_output_twitter_feed($html, $location, $cf) {
398 398
     global $post;
399 399
 
400 400
 
401
-    if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ):
401
+    if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''):
402 402
 
403 403
         $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text";
404 404
 
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
         }
414 414
 
415 415
 
416
-        $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">';
416
+        $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;">';
417 417
 
418 418
         $html .= '<a class="twitter-timeline" data-height="600" data-dnt="true" href="https://twitter.com/'.$post->{$cf['htmlvar_name']}.'">Tweets by '.$post->{$cf['htmlvar_name']}.'</a> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>';
419 419
         $html .= '</div>';
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 
423 423
     return $html;
424 424
 }
425
-add_filter('geodir_custom_field_output_text_key_twitter_feed','geodir_predefined_custom_field_output_twitter_feed',10,3);
425
+add_filter('geodir_custom_field_output_text_key_twitter_feed', 'geodir_predefined_custom_field_output_twitter_feed', 10, 3);
426 426
 
427 427
 /**
428 428
  * Filter the get_directions custom field output to show a link.
@@ -434,38 +434,38 @@  discard block
 block discarded – undo
434 434
  * @since 1.6.9
435 435
  * @return string The html to output.
436 436
  */
437
-function geodir_predefined_custom_field_output_get_directions($html,$location,$cf) {
437
+function geodir_predefined_custom_field_output_get_directions($html, $location, $cf) {
438 438
     global $post;
439 439
 
440 440
 
441
-    if ( isset( $post->{$cf['htmlvar_name']} ) && $post->{$cf['htmlvar_name']} != '' && isset( $post->post_latitude ) && $post->post_latitude ){
441
+    if (isset($post->{$cf['htmlvar_name']} ) && $post->{$cf['htmlvar_name']} != '' && isset($post->post_latitude) && $post->post_latitude) {
442 442
 
443
-        $field_icon = geodir_field_icon_proccess( $cf );
444
-        if ( strpos( $field_icon, 'http' ) !== false ) {
443
+        $field_icon = geodir_field_icon_proccess($cf);
444
+        if (strpos($field_icon, 'http') !== false) {
445 445
             $field_icon_af = '';
446
-        } elseif ( $field_icon == '' ) {
446
+        } elseif ($field_icon == '') {
447 447
             $field_icon_af = '<i class="fa fa-location-arrow"></i>';
448 448
         } else {
449 449
             $field_icon_af = $field_icon;
450 450
             $field_icon    = '';
451 451
         }
452 452
 
453
-        $link_text = isset( $post->{$cf['default_value']} ) ? $post->{$cf['default_value']} : __( 'Get Directions', 'geodirectory' );
453
+        $link_text = isset($post->{$cf['default_value']} ) ? $post->{$cf['default_value']} : __('Get Directions', 'geodirectory');
454 454
 
455
-        $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">';
455
+        $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;">';
456 456
 
457
-        if(isset( $cf['field_icon'] ) && $cf['field_icon']){
457
+        if (isset($cf['field_icon']) && $cf['field_icon']) {
458 458
             $html .= $field_icon_af;
459 459
         }
460 460
 
461 461
         // We use maps.apple.com here because it will handle redirects nicely in most cases
462
-        $html .= '<a href="https://maps.apple.com/?daddr=' . $post->post_latitude . ',' . $post->post_longitude . '" target="_blank" >' . $link_text . '</a>';
462
+        $html .= '<a href="https://maps.apple.com/?daddr='.$post->post_latitude.','.$post->post_longitude.'" target="_blank" >'.$link_text.'</a>';
463 463
         $html .= '</div>';
464 464
 
465
-    }else{
466
-        $html ='';
465
+    } else {
466
+        $html = '';
467 467
     }
468 468
 
469 469
     return $html;
470 470
 }
471
-add_filter('geodir_custom_field_output_text_key_get_directions','geodir_predefined_custom_field_output_get_directions',10,3);
471
+add_filter('geodir_custom_field_output_text_key_get_directions', 'geodir_predefined_custom_field_output_get_directions', 10, 3);
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -462,7 +462,7 @@
 block discarded – undo
462 462
         $html .= '<a href="https://maps.apple.com/?daddr=' . $post->post_latitude . ',' . $post->post_longitude . '" target="_blank" >' . $link_text . '</a>';
463 463
         $html .= '</div>';
464 464
 
465
-    }else{
465
+    } else{
466 466
         $html ='';
467 467
     }
468 468
 
Please login to merge, or discard this patch.
geodirectory-functions/compatibility/X.php 2 patches
Indentation   +218 added lines, -218 removed lines patch added patch discarded remove patch
@@ -22,60 +22,60 @@  discard block
 block discarded – undo
22 22
 function geodir_x_action_calls()
23 23
 {
24 24
 
25
-    /* ACTIONS
25
+	/* ACTIONS
26 26
     ****************************************************************************************/
27 27
 
28
-    // Add body class for styling purposes
29
-    add_filter('body_class', 'geodir_x_body_class');
28
+	// Add body class for styling purposes
29
+	add_filter('body_class', 'geodir_x_body_class');
30 30
 
31
-    // HOME TOP SIDEBAR
32
-    //remove_action( 'geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10 );
33
-    //remove_action( 'geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10 );
34
-    //add_action( 'geodir_wrapper_open', 'geodir_x_home_sidebar', 5 );
35
-    add_action('geodir_before_search_form', 'geodir_x_search_container_open');
36
-    add_action('geodir_after_search_form', 'geodir_x_search_container_close');
31
+	// HOME TOP SIDEBAR
32
+	//remove_action( 'geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10 );
33
+	//remove_action( 'geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10 );
34
+	//add_action( 'geodir_wrapper_open', 'geodir_x_home_sidebar', 5 );
35
+	add_action('geodir_before_search_form', 'geodir_x_search_container_open');
36
+	add_action('geodir_after_search_form', 'geodir_x_search_container_close');
37 37
 
38
-    // WRAPPER OPEN ACTIONS
39
-    remove_action('geodir_wrapper_open', 'geodir_action_wrapper_open', 10);
40
-    add_action('geodir_wrapper_open', 'geodir_x_action_wrapper_open', 9);
38
+	// WRAPPER OPEN ACTIONS
39
+	remove_action('geodir_wrapper_open', 'geodir_action_wrapper_open', 10);
40
+	add_action('geodir_wrapper_open', 'geodir_x_action_wrapper_open', 9);
41 41
 
42
-    // WRAPPER CLOSE ACTIONS
43
-    remove_action('geodir_wrapper_close', 'geodir_action_wrapper_close', 10);
44
-    add_action('geodir_wrapper_close', 'geodir_x_action_wrapper_close', 11);
42
+	// WRAPPER CLOSE ACTIONS
43
+	remove_action('geodir_wrapper_close', 'geodir_action_wrapper_close', 10);
44
+	add_action('geodir_wrapper_close', 'geodir_x_action_wrapper_close', 11);
45 45
 
46
-    // WRAPPER CONTENT OPEN ACTIONS
47
-    remove_action('geodir_wrapper_content_open', 'geodir_action_wrapper_content_open', 10);
48
-    add_action('geodir_wrapper_content_open', 'geodir_x_action_wrapper_content_open', 9, 3);
46
+	// WRAPPER CONTENT OPEN ACTIONS
47
+	remove_action('geodir_wrapper_content_open', 'geodir_action_wrapper_content_open', 10);
48
+	add_action('geodir_wrapper_content_open', 'geodir_x_action_wrapper_content_open', 9, 3);
49 49
 
50
-    // WRAPPER CONTENT CLOSE ACTIONS
51
-    remove_action('geodir_wrapper_content_close', 'geodir_action_wrapper_content_close', 10);
52
-    add_action('geodir_wrapper_content_close', 'geodir_x_action_wrapper_content_close', 11);
50
+	// WRAPPER CONTENT CLOSE ACTIONS
51
+	remove_action('geodir_wrapper_content_close', 'geodir_action_wrapper_content_close', 10);
52
+	add_action('geodir_wrapper_content_close', 'geodir_x_action_wrapper_content_close', 11);
53 53
 
54
-    // SIDEBAR RIGHT OPEN ACTIONS
55
-    remove_action('geodir_sidebar_right_open', 'geodir_action_sidebar_right_open', 10);
56
-    add_action('geodir_sidebar_right_open', 'geodir_x_action_sidebar_right_open', 10, 4);
54
+	// SIDEBAR RIGHT OPEN ACTIONS
55
+	remove_action('geodir_sidebar_right_open', 'geodir_action_sidebar_right_open', 10);
56
+	add_action('geodir_sidebar_right_open', 'geodir_x_action_sidebar_right_open', 10, 4);
57 57
 
58
-    // SIDEBAR RIGHT CLOSE ACTIONS
59
-    remove_action('geodir_sidebar_right_close', 'geodir_action_sidebar_right_close', 10);
60
-    add_action('geodir_sidebar_right_close', 'geodir_x_action_sidebar_right_close', 10, 1);
58
+	// SIDEBAR RIGHT CLOSE ACTIONS
59
+	remove_action('geodir_sidebar_right_close', 'geodir_action_sidebar_right_close', 10);
60
+	add_action('geodir_sidebar_right_close', 'geodir_x_action_sidebar_right_close', 10, 1);
61 61
 
62
-    // REMOVE BREADCRUMBS
63
-    remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20);
64
-    remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20);
65
-    remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20);
66
-    remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20);
67
-    remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20);
68
-    remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20);
62
+	// REMOVE BREADCRUMBS
63
+	remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20);
64
+	remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20);
65
+	remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20);
66
+	remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20);
67
+	remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20);
68
+	remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20);
69 69
 
70
-    // make top section wide
71
-    remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10);
72
-    remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10);
73
-    remove_action('geodir_author_before_main_content', 'geodir_action_geodir_sidebar_author_top', 10);
74
-    remove_action('geodir_search_before_main_content', 'geodir_action_geodir_sidebar_search_top', 10);
75
-    remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_sidebar_detail_top', 10);
76
-    remove_action('geodir_listings_before_main_content', 'geodir_action_geodir_sidebar_listings_top', 10);
70
+	// make top section wide
71
+	remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10);
72
+	remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10);
73
+	remove_action('geodir_author_before_main_content', 'geodir_action_geodir_sidebar_author_top', 10);
74
+	remove_action('geodir_search_before_main_content', 'geodir_action_geodir_sidebar_search_top', 10);
75
+	remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_sidebar_detail_top', 10);
76
+	remove_action('geodir_listings_before_main_content', 'geodir_action_geodir_sidebar_listings_top', 10);
77 77
 
78
-    add_action('geodir_wrapper_open', 'gd_X_compat_add_top_section_back', 5);
78
+	add_action('geodir_wrapper_open', 'gd_X_compat_add_top_section_back', 5);
79 79
 
80 80
 
81 81
 } // Close geodir_x_action_calls
@@ -92,17 +92,17 @@  discard block
 block discarded – undo
92 92
 function gd_X_compat_add_top_section_back()
93 93
 {
94 94
 
95
-    if (is_page_geodir_home() || geodir_is_page('location')) {
96
-        geodir_action_geodir_sidebar_home_top();
97
-    } elseif (geodir_is_page('listing')) {
98
-        geodir_action_geodir_sidebar_listings_top();
99
-    } elseif (geodir_is_page('detail')) {
100
-        geodir_action_geodir_sidebar_detail_top();
101
-    } elseif (geodir_is_page('search')) {
102
-        geodir_action_geodir_sidebar_search_top();
103
-    } elseif (geodir_is_page('author')) {
104
-        geodir_action_geodir_sidebar_author_top();
105
-    }
95
+	if (is_page_geodir_home() || geodir_is_page('location')) {
96
+		geodir_action_geodir_sidebar_home_top();
97
+	} elseif (geodir_is_page('listing')) {
98
+		geodir_action_geodir_sidebar_listings_top();
99
+	} elseif (geodir_is_page('detail')) {
100
+		geodir_action_geodir_sidebar_detail_top();
101
+	} elseif (geodir_is_page('search')) {
102
+		geodir_action_geodir_sidebar_search_top();
103
+	} elseif (geodir_is_page('author')) {
104
+		geodir_action_geodir_sidebar_author_top();
105
+	}
106 106
 
107 107
 
108 108
 }
@@ -120,12 +120,12 @@  discard block
 block discarded – undo
120 120
  */
121 121
 function geodir_x_body_class($classes)
122 122
 {
123
-    $classes[] = 'geodir-x';
123
+	$classes[] = 'geodir-x';
124 124
 
125
-    if(isset($_REQUEST['geodir_search'])){
126
-        $classes[] = 'geodir-x-search';
127
-    }
128
-    return $classes;
125
+	if(isset($_REQUEST['geodir_search'])){
126
+		$classes[] = 'geodir-x-search';
127
+	}
128
+	return $classes;
129 129
 }
130 130
 
131 131
 /**
@@ -137,14 +137,14 @@  discard block
 block discarded – undo
137 137
  */
138 138
 function geodir_x_home_sidebar()
139 139
 {
140
-    //if ( geodir_is_geodir_page() ) {
141
-    global $wp;
142
-    if ($wp->query_vars['page_id'] == geodir_location_page_id() || is_home() && !geodir_is_page('login')) {
143
-        echo '<div class="x-main full">';
144
-        dynamic_sidebar('geodir_home_top');
145
-        echo '</div>';
146
-    }
147
-    //}
140
+	//if ( geodir_is_geodir_page() ) {
141
+	global $wp;
142
+	if ($wp->query_vars['page_id'] == geodir_location_page_id() || is_home() && !geodir_is_page('login')) {
143
+		echo '<div class="x-main full">';
144
+		dynamic_sidebar('geodir_home_top');
145
+		echo '</div>';
146
+	}
147
+	//}
148 148
 }
149 149
 
150 150
 /**
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
  */
156 156
 function geodir_x_search_container_open()
157 157
 {
158
-    echo '<div class="x-container-fluid x-container max">';
158
+	echo '<div class="x-container-fluid x-container max">';
159 159
 }
160 160
 
161 161
 /**
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
  */
167 167
 function geodir_x_search_container_close()
168 168
 {
169
-    echo '</div>';
169
+	echo '</div>';
170 170
 }
171 171
 
172 172
 /**
@@ -177,19 +177,19 @@  discard block
 block discarded – undo
177 177
  */
178 178
 function geodir_x_action_wrapper_open()
179 179
 {
180
-    $stack = x_get_stack();
181
-
182
-    if ($stack == 'integrity') {
183
-        echo '<div class="x-container-fluid x-container max width offset">';
184
-    } elseif ($stack == 'renew') {
185
-        echo '<div class="x-container-fluid x-container max width offset cf">';
186
-    } elseif ($stack == 'icon') {
187
-        echo '<div class="x-main full" role="main">';
188
-    } elseif ($stack == 'ethos') {
189
-        echo '<div class="x-container-fluid x-container max width main"><div class="offset cf">';
190
-    }else{
191
-        echo '<div class="x-container max width offset">';
192
-    }
180
+	$stack = x_get_stack();
181
+
182
+	if ($stack == 'integrity') {
183
+		echo '<div class="x-container-fluid x-container max width offset">';
184
+	} elseif ($stack == 'renew') {
185
+		echo '<div class="x-container-fluid x-container max width offset cf">';
186
+	} elseif ($stack == 'icon') {
187
+		echo '<div class="x-main full" role="main">';
188
+	} elseif ($stack == 'ethos') {
189
+		echo '<div class="x-container-fluid x-container max width main"><div class="offset cf">';
190
+	}else{
191
+		echo '<div class="x-container max width offset">';
192
+	}
193 193
 }
194 194
 
195 195
 /**
@@ -200,12 +200,12 @@  discard block
 block discarded – undo
200 200
  */
201 201
 function geodir_x_action_wrapper_close()
202 202
 {
203
-    $stack = x_get_stack();
204
-    if ($stack == 'ethos') {
205
-        echo '</div></div>';
206
-    } else {
207
-        echo '</div>';
208
-    }
203
+	$stack = x_get_stack();
204
+	if ($stack == 'ethos') {
205
+		echo '</div></div>';
206
+	} else {
207
+		echo '</div>';
208
+	}
209 209
 }
210 210
 
211 211
 /**
@@ -219,9 +219,9 @@  discard block
 block discarded – undo
219 219
  */
220 220
 function geodir_x_action_wrapper_content_open($type = '', $id = '', $class = '')
221 221
 {
222
-    $content_class = ' entry-wrap ';
222
+	$content_class = ' entry-wrap ';
223 223
 
224
-    echo '<div class="x-main left ' . $class . $content_class . ' " role="main">';
224
+	echo '<div class="x-main left ' . $class . $content_class . ' " role="main">';
225 225
 }
226 226
 
227 227
 /**
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
  */
233 233
 function geodir_x_action_wrapper_content_close()
234 234
 {
235
-    echo '</div>';
235
+	echo '</div>';
236 236
 }
237 237
 
238 238
 /**
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
  */
248 248
 function geodir_x_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
249 249
 {
250
-    echo '<aside class="x-sidebar right" role="complementary" itemscope itemtype="' . $itemtype . '">';
250
+	echo '<aside class="x-sidebar right" role="complementary" itemscope itemtype="' . $itemtype . '">';
251 251
 }
252 252
 
253 253
 /**
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
  */
260 260
 function geodir_x_action_sidebar_right_close($type = '')
261 261
 {
262
-    echo '</aside>';
262
+	echo '</aside>';
263 263
 }
264 264
 
265 265
 add_filter('geodir_breadcrumb', 'geodir_x_breadcrumb');
@@ -273,12 +273,12 @@  discard block
 block discarded – undo
273 273
  */
274 274
 function geodir_x_breadcrumb($breadcrumb)
275 275
 {
276
-    $breadcrumb = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs">', '', $breadcrumb);
277
-    $breadcrumb = str_replace('<li>', '', $breadcrumb);
278
-    $breadcrumb = str_replace('</li>', '', $breadcrumb);
279
-    $breadcrumb = str_replace('Home', '<span class="home"><i class="x-icon-home"></i></span>', $breadcrumb);
280
-    $breadcrumb = str_replace('</ul></div>', '', $breadcrumb);
281
-    return $breadcrumb;
276
+	$breadcrumb = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs">', '', $breadcrumb);
277
+	$breadcrumb = str_replace('<li>', '', $breadcrumb);
278
+	$breadcrumb = str_replace('</li>', '', $breadcrumb);
279
+	$breadcrumb = str_replace('Home', '<span class="home"><i class="x-icon-home"></i></span>', $breadcrumb);
280
+	$breadcrumb = str_replace('</ul></div>', '', $breadcrumb);
281
+	return $breadcrumb;
282 282
 }
283 283
 
284 284
 add_filter('geodir_breadcrumb_separator', 'geodir_x_breadcrumb_separator');
@@ -292,125 +292,125 @@  discard block
 block discarded – undo
292 292
  */
293 293
 function geodir_x_breadcrumb_separator($separator)
294 294
 {
295
-    $separator = str_replace(' > ', ' <span class="delimiter"><i class="x-icon-angle-right"></i></span> ', $separator);
296
-    return $separator;
295
+	$separator = str_replace(' > ', ' <span class="delimiter"><i class="x-icon-angle-right"></i></span> ', $separator);
296
+	return $separator;
297 297
 }
298 298
 
299 299
 if (!function_exists('x_breadcrumbs')) :
300
-    /**
301
-     * breadcrumbs.
302
-     *
303
-     * @since 1.0.0
304
-     * @package GeoDirectory
305
-     */
306
-    function x_breadcrumbs()
307
-    {
308
-
309
-        if (x_get_option('x_breadcrumb_display', '1')) {
310
-
311
-            //
312
-            // 1. Delimiter between crumbs.
313
-            // 2. Output text for the "Home" link.
314
-            // 3. Link to the home page.
315
-            // 4. Tag before the current crumb.
316
-            // 5. Tag after the current crumb.
317
-            // 6. Get page title.
318
-            // 7. Get blog title.
319
-            // 8. Get shop title.
320
-            //
321
-
322
-            GLOBAL $post,$wp;
323
-
324
-            if (geodir_is_page('detail') || geodir_is_page('listing') || (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_location_page_id())) {
325
-                geodir_breadcrumb();
326
-            } else {
327
-
328
-                $stack = x_get_stack();
329
-                $delimiter = ' <span class="delimiter"><i class="x-icon-angle-right"></i></span> '; // 1
330
-                $home_text = '<span class="home"><i class="x-icon-home"></i></span>';               // 2
331
-                $home_link = home_url();                                                            // 3
332
-                $current_before = '<span class="current">';                                              // 4
333
-                $current_after = '</span>';                                                             // 5
334
-                $page_title = get_the_title();                                                       // 6
335
-                $blog_title = get_the_title(get_option('page_for_posts', true));                 // 7
336
-                $shop_title = get_theme_mod('x_' . $stack . '_shop_title');                        // 8
337
-
338
-                if (function_exists('woocommerce_get_page_id')) {
339
-                    $shop_url = x_get_shop_link();
340
-                    $shop_link = '<a href="' . $shop_url . '">' . $shop_title . '</a>';
341
-                }
342
-
343
-                if (is_front_page()) {
344
-                    echo '<div class="x-breadcrumbs">' . $current_before . $home_text . $current_after . '</div>';
345
-                } elseif (is_home()) {
346
-                    echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter . $current_before . $blog_title . $current_after . '</div>';
347
-                } else {
348
-                    echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter;
349
-                    if (is_category()) {
350
-                        $the_cat = get_category(get_query_var('cat'), false);
351
-                        if ($the_cat->parent != 0) echo get_category_parents($the_cat->parent, TRUE, $delimiter);
352
-                        echo $current_before . single_cat_title('', false) . $current_after;
353
-                    } elseif (x_is_product_category()) {
354
-                        echo $shop_link . $delimiter . $current_before . single_cat_title('', false) . $current_after;
355
-                    } elseif (x_is_product_tag()) {
356
-                        echo $shop_link . $delimiter . $current_before . single_tag_title('', false) . $current_after;
357
-                    } elseif (is_search()) {
358
-                        echo $current_before . __('Search Results for ', '__x__') . '&#8220;' . get_search_query() . '&#8221;' . $current_after;
359
-                    } elseif (is_singular('post')) {
360
-                        if (get_option('page_for_posts') == is_front_page()) {
361
-                            echo $current_before . $page_title . $current_after;
362
-                        } else {
363
-                            echo '<a href="' . get_permalink(get_option('page_for_posts')) . '" title="' . esc_attr(__('See All Posts', '__x__')) . '">' . $blog_title . '</a>' . $delimiter . $current_before . $page_title . $current_after;
364
-                        }
365
-                    } elseif (x_is_portfolio()) {
366
-                        echo $current_before . get_the_title() . $current_after;
367
-                    } elseif (x_is_portfolio_item()) {
368
-                        $link = x_get_parent_portfolio_link();
369
-                        $title = x_get_parent_portfolio_title();
370
-                        echo '<a href="' . $link . '" title="' . esc_attr(__('See All Posts', '__x__')) . '">' . $title . '</a>' . $delimiter . $current_before . $page_title . $current_after;
371
-                    } elseif (x_is_product()) {
372
-                        echo $shop_link . $delimiter . $current_before . $page_title . $current_after;
373
-                    } elseif (is_page() && !$post->post_parent) {
374
-                        echo $current_before . $page_title . $current_after;
375
-                    } elseif (is_page() && $post->post_parent) {
376
-                        $parent_id = $post->post_parent;
377
-                        $breadcrumbs = array();
378
-                        while ($parent_id) {
379
-                            $page = get_page($parent_id);
380
-                            $breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a>';
381
-                            $parent_id = $page->post_parent;
382
-                        }
383
-                        $breadcrumbs = array_reverse($breadcrumbs);
384
-                        for ($i = 0; $i < count($breadcrumbs); $i++) {
385
-                            echo $breadcrumbs[$i];
386
-                            if ($i != count($breadcrumbs) - 1) echo $delimiter;
387
-                        }
388
-                        echo $delimiter . $current_before . $page_title . $current_after;
389
-                    } elseif (is_tag()) {
390
-                        echo $current_before . single_tag_title('', false) . $current_after;
391
-                    } elseif (is_author()) {
392
-                        GLOBAL $author;
393
-                        $userdata = get_userdata($author);
394
-                        echo $current_before . __('Posts by ', '__x__') . '&#8220;' . $userdata->display_name . $current_after . '&#8221;';
395
-                    } elseif (is_404()) {
396
-                        echo $current_before . __('404 (Page Not Found)', '__x__') . $current_after;
397
-                    } elseif (is_archive()) {
398
-                        if (x_is_shop()) {
399
-                            echo $current_before . $shop_title . $current_after;
400
-                        } else {
401
-                            echo $current_before . __('Archives ', '__x__') . $current_after;
402
-                        }
403
-                    }
404
-                    if (get_query_var('paged')) {
405
-                        echo ' <span class="current" style="white-space: nowrap;">(' . __('Page', '__x__') . ' ' . get_query_var('paged') . ')</span>';
406
-                    }
407
-                    echo '</div>';
408
-                }
409
-
410
-            }
411
-
412
-        }
413
-    } // ends my geodir check
300
+	/**
301
+	 * breadcrumbs.
302
+	 *
303
+	 * @since 1.0.0
304
+	 * @package GeoDirectory
305
+	 */
306
+	function x_breadcrumbs()
307
+	{
308
+
309
+		if (x_get_option('x_breadcrumb_display', '1')) {
310
+
311
+			//
312
+			// 1. Delimiter between crumbs.
313
+			// 2. Output text for the "Home" link.
314
+			// 3. Link to the home page.
315
+			// 4. Tag before the current crumb.
316
+			// 5. Tag after the current crumb.
317
+			// 6. Get page title.
318
+			// 7. Get blog title.
319
+			// 8. Get shop title.
320
+			//
321
+
322
+			GLOBAL $post,$wp;
323
+
324
+			if (geodir_is_page('detail') || geodir_is_page('listing') || (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_location_page_id())) {
325
+				geodir_breadcrumb();
326
+			} else {
327
+
328
+				$stack = x_get_stack();
329
+				$delimiter = ' <span class="delimiter"><i class="x-icon-angle-right"></i></span> '; // 1
330
+				$home_text = '<span class="home"><i class="x-icon-home"></i></span>';               // 2
331
+				$home_link = home_url();                                                            // 3
332
+				$current_before = '<span class="current">';                                              // 4
333
+				$current_after = '</span>';                                                             // 5
334
+				$page_title = get_the_title();                                                       // 6
335
+				$blog_title = get_the_title(get_option('page_for_posts', true));                 // 7
336
+				$shop_title = get_theme_mod('x_' . $stack . '_shop_title');                        // 8
337
+
338
+				if (function_exists('woocommerce_get_page_id')) {
339
+					$shop_url = x_get_shop_link();
340
+					$shop_link = '<a href="' . $shop_url . '">' . $shop_title . '</a>';
341
+				}
342
+
343
+				if (is_front_page()) {
344
+					echo '<div class="x-breadcrumbs">' . $current_before . $home_text . $current_after . '</div>';
345
+				} elseif (is_home()) {
346
+					echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter . $current_before . $blog_title . $current_after . '</div>';
347
+				} else {
348
+					echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter;
349
+					if (is_category()) {
350
+						$the_cat = get_category(get_query_var('cat'), false);
351
+						if ($the_cat->parent != 0) echo get_category_parents($the_cat->parent, TRUE, $delimiter);
352
+						echo $current_before . single_cat_title('', false) . $current_after;
353
+					} elseif (x_is_product_category()) {
354
+						echo $shop_link . $delimiter . $current_before . single_cat_title('', false) . $current_after;
355
+					} elseif (x_is_product_tag()) {
356
+						echo $shop_link . $delimiter . $current_before . single_tag_title('', false) . $current_after;
357
+					} elseif (is_search()) {
358
+						echo $current_before . __('Search Results for ', '__x__') . '&#8220;' . get_search_query() . '&#8221;' . $current_after;
359
+					} elseif (is_singular('post')) {
360
+						if (get_option('page_for_posts') == is_front_page()) {
361
+							echo $current_before . $page_title . $current_after;
362
+						} else {
363
+							echo '<a href="' . get_permalink(get_option('page_for_posts')) . '" title="' . esc_attr(__('See All Posts', '__x__')) . '">' . $blog_title . '</a>' . $delimiter . $current_before . $page_title . $current_after;
364
+						}
365
+					} elseif (x_is_portfolio()) {
366
+						echo $current_before . get_the_title() . $current_after;
367
+					} elseif (x_is_portfolio_item()) {
368
+						$link = x_get_parent_portfolio_link();
369
+						$title = x_get_parent_portfolio_title();
370
+						echo '<a href="' . $link . '" title="' . esc_attr(__('See All Posts', '__x__')) . '">' . $title . '</a>' . $delimiter . $current_before . $page_title . $current_after;
371
+					} elseif (x_is_product()) {
372
+						echo $shop_link . $delimiter . $current_before . $page_title . $current_after;
373
+					} elseif (is_page() && !$post->post_parent) {
374
+						echo $current_before . $page_title . $current_after;
375
+					} elseif (is_page() && $post->post_parent) {
376
+						$parent_id = $post->post_parent;
377
+						$breadcrumbs = array();
378
+						while ($parent_id) {
379
+							$page = get_page($parent_id);
380
+							$breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a>';
381
+							$parent_id = $page->post_parent;
382
+						}
383
+						$breadcrumbs = array_reverse($breadcrumbs);
384
+						for ($i = 0; $i < count($breadcrumbs); $i++) {
385
+							echo $breadcrumbs[$i];
386
+							if ($i != count($breadcrumbs) - 1) echo $delimiter;
387
+						}
388
+						echo $delimiter . $current_before . $page_title . $current_after;
389
+					} elseif (is_tag()) {
390
+						echo $current_before . single_tag_title('', false) . $current_after;
391
+					} elseif (is_author()) {
392
+						GLOBAL $author;
393
+						$userdata = get_userdata($author);
394
+						echo $current_before . __('Posts by ', '__x__') . '&#8220;' . $userdata->display_name . $current_after . '&#8221;';
395
+					} elseif (is_404()) {
396
+						echo $current_before . __('404 (Page Not Found)', '__x__') . $current_after;
397
+					} elseif (is_archive()) {
398
+						if (x_is_shop()) {
399
+							echo $current_before . $shop_title . $current_after;
400
+						} else {
401
+							echo $current_before . __('Archives ', '__x__') . $current_after;
402
+						}
403
+					}
404
+					if (get_query_var('paged')) {
405
+						echo ' <span class="current" style="white-space: nowrap;">(' . __('Page', '__x__') . ' ' . get_query_var('paged') . ')</span>';
406
+					}
407
+					echo '</div>';
408
+				}
409
+
410
+			}
411
+
412
+		}
413
+	} // ends my geodir check
414 414
 endif;
415 415
 
416 416
 
@@ -425,8 +425,8 @@  discard block
 block discarded – undo
425 425
  */
426 426
 function geodir_x_location_switcher_menu_li_class($class)
427 427
 {
428
-    $class .= " menu-item-has-children ";
429
-    return $class;
428
+	$class .= " menu-item-has-children ";
429
+	return $class;
430 430
 }
431 431
 
432 432
 add_filter('geodir_sub_menu_li_class', 'geodir_x_sub_menu_li_class', 10, 1);
@@ -440,6 +440,6 @@  discard block
 block discarded – undo
440 440
  */
441 441
 function geodir_x_sub_menu_li_class($class)
442 442
 {
443
-    $class .= " menu-item-has-children ";
444
-    return $class;
443
+	$class .= " menu-item-has-children ";
444
+	return $class;
445 445
 }
Please login to merge, or discard this patch.
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 {
123 123
     $classes[] = 'geodir-x';
124 124
 
125
-    if(isset($_REQUEST['geodir_search'])){
125
+    if (isset($_REQUEST['geodir_search'])) {
126 126
         $classes[] = 'geodir-x-search';
127 127
     }
128 128
     return $classes;
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
         echo '<div class="x-main full" role="main">';
188 188
     } elseif ($stack == 'ethos') {
189 189
         echo '<div class="x-container-fluid x-container max width main"><div class="offset cf">';
190
-    }else{
190
+    } else {
191 191
         echo '<div class="x-container max width offset">';
192 192
     }
193 193
 }
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 {
222 222
     $content_class = ' entry-wrap ';
223 223
 
224
-    echo '<div class="x-main left ' . $class . $content_class . ' " role="main">';
224
+    echo '<div class="x-main left '.$class.$content_class.' " role="main">';
225 225
 }
226 226
 
227 227
 /**
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
  */
248 248
 function geodir_x_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
249 249
 {
250
-    echo '<aside class="x-sidebar right" role="complementary" itemscope itemtype="' . $itemtype . '">';
250
+    echo '<aside class="x-sidebar right" role="complementary" itemscope itemtype="'.$itemtype.'">';
251 251
 }
252 252
 
253 253
 /**
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
             // 8. Get shop title.
320 320
             //
321 321
 
322
-            GLOBAL $post,$wp;
322
+            GLOBAL $post, $wp;
323 323
 
324 324
             if (geodir_is_page('detail') || geodir_is_page('listing') || (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_location_page_id())) {
325 325
                 geodir_breadcrumb();
@@ -327,57 +327,57 @@  discard block
 block discarded – undo
327 327
 
328 328
                 $stack = x_get_stack();
329 329
                 $delimiter = ' <span class="delimiter"><i class="x-icon-angle-right"></i></span> '; // 1
330
-                $home_text = '<span class="home"><i class="x-icon-home"></i></span>';               // 2
331
-                $home_link = home_url();                                                            // 3
332
-                $current_before = '<span class="current">';                                              // 4
333
-                $current_after = '</span>';                                                             // 5
334
-                $page_title = get_the_title();                                                       // 6
335
-                $blog_title = get_the_title(get_option('page_for_posts', true));                 // 7
336
-                $shop_title = get_theme_mod('x_' . $stack . '_shop_title');                        // 8
330
+                $home_text = '<span class="home"><i class="x-icon-home"></i></span>'; // 2
331
+                $home_link = home_url(); // 3
332
+                $current_before = '<span class="current">'; // 4
333
+                $current_after = '</span>'; // 5
334
+                $page_title = get_the_title(); // 6
335
+                $blog_title = get_the_title(get_option('page_for_posts', true)); // 7
336
+                $shop_title = get_theme_mod('x_'.$stack.'_shop_title'); // 8
337 337
 
338 338
                 if (function_exists('woocommerce_get_page_id')) {
339 339
                     $shop_url = x_get_shop_link();
340
-                    $shop_link = '<a href="' . $shop_url . '">' . $shop_title . '</a>';
340
+                    $shop_link = '<a href="'.$shop_url.'">'.$shop_title.'</a>';
341 341
                 }
342 342
 
343 343
                 if (is_front_page()) {
344
-                    echo '<div class="x-breadcrumbs">' . $current_before . $home_text . $current_after . '</div>';
344
+                    echo '<div class="x-breadcrumbs">'.$current_before.$home_text.$current_after.'</div>';
345 345
                 } elseif (is_home()) {
346
-                    echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter . $current_before . $blog_title . $current_after . '</div>';
346
+                    echo '<div class="x-breadcrumbs"><a href="'.$home_link.'">'.$home_text.'</a>'.$delimiter.$current_before.$blog_title.$current_after.'</div>';
347 347
                 } else {
348
-                    echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter;
348
+                    echo '<div class="x-breadcrumbs"><a href="'.$home_link.'">'.$home_text.'</a>'.$delimiter;
349 349
                     if (is_category()) {
350 350
                         $the_cat = get_category(get_query_var('cat'), false);
351 351
                         if ($the_cat->parent != 0) echo get_category_parents($the_cat->parent, TRUE, $delimiter);
352
-                        echo $current_before . single_cat_title('', false) . $current_after;
352
+                        echo $current_before.single_cat_title('', false).$current_after;
353 353
                     } elseif (x_is_product_category()) {
354
-                        echo $shop_link . $delimiter . $current_before . single_cat_title('', false) . $current_after;
354
+                        echo $shop_link.$delimiter.$current_before.single_cat_title('', false).$current_after;
355 355
                     } elseif (x_is_product_tag()) {
356
-                        echo $shop_link . $delimiter . $current_before . single_tag_title('', false) . $current_after;
356
+                        echo $shop_link.$delimiter.$current_before.single_tag_title('', false).$current_after;
357 357
                     } elseif (is_search()) {
358
-                        echo $current_before . __('Search Results for ', '__x__') . '&#8220;' . get_search_query() . '&#8221;' . $current_after;
358
+                        echo $current_before.__('Search Results for ', '__x__').'&#8220;'.get_search_query().'&#8221;'.$current_after;
359 359
                     } elseif (is_singular('post')) {
360 360
                         if (get_option('page_for_posts') == is_front_page()) {
361
-                            echo $current_before . $page_title . $current_after;
361
+                            echo $current_before.$page_title.$current_after;
362 362
                         } else {
363
-                            echo '<a href="' . get_permalink(get_option('page_for_posts')) . '" title="' . esc_attr(__('See All Posts', '__x__')) . '">' . $blog_title . '</a>' . $delimiter . $current_before . $page_title . $current_after;
363
+                            echo '<a href="'.get_permalink(get_option('page_for_posts')).'" title="'.esc_attr(__('See All Posts', '__x__')).'">'.$blog_title.'</a>'.$delimiter.$current_before.$page_title.$current_after;
364 364
                         }
365 365
                     } elseif (x_is_portfolio()) {
366
-                        echo $current_before . get_the_title() . $current_after;
366
+                        echo $current_before.get_the_title().$current_after;
367 367
                     } elseif (x_is_portfolio_item()) {
368 368
                         $link = x_get_parent_portfolio_link();
369 369
                         $title = x_get_parent_portfolio_title();
370
-                        echo '<a href="' . $link . '" title="' . esc_attr(__('See All Posts', '__x__')) . '">' . $title . '</a>' . $delimiter . $current_before . $page_title . $current_after;
370
+                        echo '<a href="'.$link.'" title="'.esc_attr(__('See All Posts', '__x__')).'">'.$title.'</a>'.$delimiter.$current_before.$page_title.$current_after;
371 371
                     } elseif (x_is_product()) {
372
-                        echo $shop_link . $delimiter . $current_before . $page_title . $current_after;
372
+                        echo $shop_link.$delimiter.$current_before.$page_title.$current_after;
373 373
                     } elseif (is_page() && !$post->post_parent) {
374
-                        echo $current_before . $page_title . $current_after;
374
+                        echo $current_before.$page_title.$current_after;
375 375
                     } elseif (is_page() && $post->post_parent) {
376 376
                         $parent_id = $post->post_parent;
377 377
                         $breadcrumbs = array();
378 378
                         while ($parent_id) {
379 379
                             $page = get_page($parent_id);
380
-                            $breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a>';
380
+                            $breadcrumbs[] = '<a href="'.get_permalink($page->ID).'">'.get_the_title($page->ID).'</a>';
381 381
                             $parent_id = $page->post_parent;
382 382
                         }
383 383
                         $breadcrumbs = array_reverse($breadcrumbs);
@@ -385,24 +385,24 @@  discard block
 block discarded – undo
385 385
                             echo $breadcrumbs[$i];
386 386
                             if ($i != count($breadcrumbs) - 1) echo $delimiter;
387 387
                         }
388
-                        echo $delimiter . $current_before . $page_title . $current_after;
388
+                        echo $delimiter.$current_before.$page_title.$current_after;
389 389
                     } elseif (is_tag()) {
390
-                        echo $current_before . single_tag_title('', false) . $current_after;
390
+                        echo $current_before.single_tag_title('', false).$current_after;
391 391
                     } elseif (is_author()) {
392 392
                         GLOBAL $author;
393 393
                         $userdata = get_userdata($author);
394
-                        echo $current_before . __('Posts by ', '__x__') . '&#8220;' . $userdata->display_name . $current_after . '&#8221;';
394
+                        echo $current_before.__('Posts by ', '__x__').'&#8220;'.$userdata->display_name.$current_after.'&#8221;';
395 395
                     } elseif (is_404()) {
396
-                        echo $current_before . __('404 (Page Not Found)', '__x__') . $current_after;
396
+                        echo $current_before.__('404 (Page Not Found)', '__x__').$current_after;
397 397
                     } elseif (is_archive()) {
398 398
                         if (x_is_shop()) {
399
-                            echo $current_before . $shop_title . $current_after;
399
+                            echo $current_before.$shop_title.$current_after;
400 400
                         } else {
401
-                            echo $current_before . __('Archives ', '__x__') . $current_after;
401
+                            echo $current_before.__('Archives ', '__x__').$current_after;
402 402
                         }
403 403
                     }
404 404
                     if (get_query_var('paged')) {
405
-                        echo ' <span class="current" style="white-space: nowrap;">(' . __('Page', '__x__') . ' ' . get_query_var('paged') . ')</span>';
405
+                        echo ' <span class="current" style="white-space: nowrap;">('.__('Page', '__x__').' '.get_query_var('paged').')</span>';
406 406
                     }
407 407
                     echo '</div>';
408 408
                 }
Please login to merge, or discard this patch.