Test Failed
Push — master ( 3b1e42...ed3296 )
by Stiofan
12:47
created
geodirectory-functions/custom_fields_predefined.php 1 patch
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'        =>  'fas fa-dollar-sign',
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'          =>  'fas fa-dollar-sign',
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'        =>  'fas 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'          =>  'fas 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'        =>  'fas 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'          =>  'fas 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'        =>  'fas 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'          =>  'fas 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'        =>  'fas 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'          =>  'fas 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'        =>  'fas 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'          =>  'fas 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'        =>  'fas 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'          =>  'fas fa-chart-area',
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'        =>  'fas 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'          =>  'fas 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'        =>  'fab 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'          =>  'fab 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'        =>  'fas 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'          =>  'fas 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'        =>  'fas 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'          =>  'fas 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'        =>  'fas 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'          =>  'fas 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'        =>  'fas fa-dollar-sign',
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'          =>  'fas fa-dollar-sign',
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'        =>  'fas 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'          =>  'fas 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'        =>  'fas 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'          =>  'fas 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'        =>  'fas 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'          =>  'fas 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'        =>  'fas 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'          =>  'fas 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'        =>  'fas 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'          =>  'fas 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'        =>  'fas 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'          =>  'fas fa-chart-area',
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'        =>  'fas 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'          =>  'fas 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'        =>  'fab 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'          =>  'fab 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'        =>  'fas 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'          =>  'fas 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'        =>  'fas 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'          =>  'fas 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'        =>  'fas 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'          =>  'fas 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="far fa-clock"></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="far fa-clock"></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="fas 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="fas fa-location-arrow"></i>';
448
+		} else {
449
+			$field_icon_af = $field_icon;
450
+			$field_icon    = '';
451
+		}
452 452
 
453
-        $link_text = !empty( $cf['default_value']) ? $cf['default_value'] : __( 'Get Directions', 'geodirectory' );
453
+		$link_text = !empty( $cf['default_value']) ? $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.