Function Reference: geodir_get_cat_sort_fields

Summary

This function has not been documented yet.

Source File

geodir_get_cat_sort_fields() is located in geodir_advance_search_filters/geodirectory_advance_search_function.php [Line: 107]

Source Code

function geodir_get_cat_sort_fields($sort_fields){
	global $wpdb;
	
	$post_type = geodir_get_current_posttype();
	
	
	$custom_sort_fields = array();
	
	if($custom_fields = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE cat_sort <> '' AND field_type NOT IN ('html','multiselect','file','textarea') AND post_type = %s ORDER BY sort_order",array($post_type))))
	{
		foreach($custom_fields as $custom_field){
			switch($custom_field->field_type):
				case 'address':
				$custom_sort_fields[$custom_field->htmlvar_name.'_address'] = __($custom_field->site_title);
				break;
				default:
				$custom_sort_fields[$custom_field->htmlvar_name] = __($custom_field->site_title);	
				break;
			endswitch;	
		}
	}	
	
	return array_merge($sort_fields,$custom_sort_fields);
		
}