function epl_register_taxonomy_location()
{
    $location_label = epl_tax_location_label();
    $location_slug = sanitize_title($location_label);
    $hierarchical = defined('EPL_LOCATION_HIERARCHICAL') && EPL_LOCATION_HIERARCHICAL ? true : false;
    /* add define ('EPL_LOCATION_HIERARCHICAL', 'true'); into theme functions.php for hierarchical location taxonomy */
    $labels = array('name' => _x($location_label, 'Taxonomy General Name', 'epl'), 'singular_name' => _x($location_label, 'Taxonomy Singular Name', 'epl'), 'menu_name' => __($location_label, 'epl'), 'all_items' => __('All ' . $location_label, 'epl'), 'parent_item' => __('Parent ' . $location_label, 'epl'), 'parent_item_colon' => __('Parent ' . $location_label . ':', 'epl'), 'new_item_name' => __('New ' . $location_label . ' Name', 'epl'), 'add_new_item' => __('Add New ' . $location_label, 'epl'), 'edit_item' => __('Edit ' . $location_label, 'epl'), 'update_item' => __('Update ' . $location_label, 'epl'), 'separate_items_with_commas' => __('Separate ' . $location_label . ' with commas', 'epl'), 'search_items' => __('Search ' . $location_label, 'epl'), 'add_or_remove_items' => __('Add or remove ' . $location_label, 'epl'), 'choose_from_most_used' => __('Choose from the most used ' . $location_label, 'epl'), 'not_found' => __($location_label . ' Not Found', 'epl'));
    $rewrite = array('slug' => $location_slug, 'with_front' => true, 'hierarchical' => $hierarchical);
    $args = array('labels' => $labels, 'hierarchical' => $hierarchical, 'public' => true, 'show_ui' => true, 'show_admin_column' => true, 'show_in_nav_menus' => true, 'show_tagcloud' => true, 'rewrite' => $rewrite);
    register_taxonomy('location', array('property', 'rental', 'land', 'rural', 'business', 'commercial', 'commercial_land', 'testimonial', 'location'), $args);
}
/**
 * search widget form fields for search widget - frontend 
 * @since 2.2
 */
function epl_search_widget_fields_frontend($post_type = '', $property_status = '')
{
    if ($post_type == 'rental' || $post_type == 'holiday_rental') {
        $price_array = array_combine(range(50, 5000, 50), array_map('epl_currency_formatted_amount', range(50, 5000, 50)));
        $price_array = apply_filters('epl_listing_search_price_rental', $price_array);
    } else {
        $price_array = array_combine(range(50000, 10000000, 50000), array_map('epl_currency_formatted_amount', range(50000, 10000000, 50000)));
        $price_array = apply_filters('epl_listing_search_price_sale', $price_array);
    }
    if (isset($post_type) && ($post_type == 'rental' || $post_type == 'holiday_rental')) {
        $price_meta_key = 'property_rent';
    } else {
        $price_meta_key = 'property_price';
    }
    $fields = apply_filters('epl_search_widget_fields_frontend', array(array('key' => 'post_type', 'meta_key' => 'post_type', 'type' => 'hidden'), array('key' => 'property_status', 'meta_key' => 'property_status', 'type' => 'hidden', 'query' => array('query' => 'meta')), array('key' => 'search_id', 'meta_key' => 'property_id', 'label' => __('Search by Property ID / Address', 'epl'), 'type' => 'text', 'class' => 'epl-search-row-full', 'query' => array('query' => 'meta', 'key' => 'property_unique_id')), array('key' => 'search_location', 'meta_key' => 'property_location', 'label' => epl_tax_location_label(), 'type' => 'select', 'option_filter' => 'location', 'options' => epl_get_available_locations($post_type, $property_status), 'query' => array('query' => 'tax'), 'class' => 'epl-search-row-full'), array('key' => 'search_city', 'meta_key' => 'property_address_city', 'label' => epl_labels('label_city'), 'type' => 'select', 'option_filter' => 'city', 'options' => epl_get_unique_post_meta_values('property_address_city', $post_type), 'query' => array('query' => 'meta'), 'class' => 'epl-search-row-half'), array('key' => 'search_state', 'meta_key' => 'property_address_state', 'label' => epl_labels('label_state'), 'type' => 'select', 'option_filter' => 'state', 'options' => epl_get_unique_post_meta_values('property_address_state', $post_type), 'query' => array('query' => 'meta'), 'class' => 'epl-search-row-half'), array('key' => 'search_postcode', 'meta_key' => 'property_address_postal_code', 'label' => epl_labels('label_postcode'), 'type' => 'select', 'option_filter' => 'postcode', 'options' => epl_get_unique_post_meta_values('property_address_postal_code', $post_type), 'query' => array('query' => 'meta'), 'class' => 'epl-search-row-half'), array('key' => 'search_country', 'meta_key' => 'property_address_country', 'label' => __('Country', 'epl'), 'type' => 'select', 'option_filter' => 'country', 'options' => epl_get_unique_post_meta_values('property_address_country', $post_type), 'query' => array('query' => 'meta'), 'class' => 'epl-search-row-half'), array('key' => 'search_house_category', 'meta_key' => 'property_category', 'label' => __('House Category', 'epl'), 'option_filter' => 'category', 'options' => epl_get_meta_values('property_category', $post_type), 'type' => 'select', 'query' => array('query' => 'meta'), 'class' => 'epl-search-row-full', 'exclude' => array('rural', 'land', 'commercial', 'commercial_land', 'business')), array('key' => 'search_house_category', 'meta_key' => 'property_rural_category', 'label' => __('Rural Category', 'epl'), 'option_filter' => 'category', 'options' => epl_get_meta_values('property_rural_category', $post_type), 'type' => 'select', 'query' => array('query' => 'meta'), 'class' => 'epl-search-row-full', 'exclude' => array('property', 'rental', 'land', 'commercial', 'commercial_land', 'business')), array('key' => 'search_house_category', 'meta_key' => 'property_land_category', 'label' => __('Land Category', 'epl'), 'option_filter' => 'category', 'options' => epl_get_meta_values('property_land_category', $post_type), 'type' => 'select', 'query' => array('query' => 'meta'), 'class' => 'epl-search-row-full', 'exclude' => array('property', 'rental', 'rural', 'commercial', 'commercial_land', 'business')), array('key' => 'search_house_category', 'meta_key' => 'property_commercial_category', 'label' => __('Commercial Category', 'epl'), 'option_filter' => 'category', 'options' => epl_get_meta_values('property_commercial_category', $post_type), 'type' => 'select', 'query' => array('query' => 'meta'), 'class' => 'epl-search-row-full', 'exclude' => array('property', 'rental', 'land', 'rural', 'business')), array('key' => 'search_house_category', 'meta_key' => 'property_business_category', 'label' => __('Business Category', 'epl'), 'option_filter' => 'category', 'options' => epl_get_meta_values('property_business_category', $post_type), 'type' => 'select', 'query' => array('query' => 'meta'), 'class' => 'epl-search-row-full', 'exclude' => array('property', 'rental', 'land', 'rural', 'commercial', 'commercial_land')), array('key' => 'search_price', 'meta_key' => 'property_price_from', 'label' => __('Price From', 'epl'), 'type' => 'select', 'option_filter' => 'price_from', 'options' => $price_array, 'type' => 'select', 'query' => array('query' => 'meta', 'key' => $price_meta_key, 'type' => 'numeric', 'compare' => '>='), 'class' => 'epl-search-row-half'), array('key' => 'search_price', 'meta_key' => 'property_price_to', 'label' => __('Price To', 'epl'), 'type' => 'select', 'option_filter' => 'price_to', 'options' => $price_array, 'type' => 'select', 'query' => array('query' => 'meta', 'key' => $price_meta_key, 'type' => 'numeric', 'compare' => '<='), 'class' => 'epl-search-row-half'), array('key' => 'search_bed', 'meta_key' => 'property_bedrooms_min', 'label' => __('Bedrooms Min', 'epl'), 'option_filter' => 'bedrooms_min', 'options' => apply_filters('epl_listing_search_bed_select_min', array_combine(range(1, 10), array_map('epl_number_suffix_callback', range(1, 10)))), 'type' => 'select', 'exclude' => array('land', 'commercial', 'commercial_land', 'business'), 'query' => array('query' => 'meta', 'key' => 'property_bedrooms', 'type' => 'numeric', 'compare' => '>='), 'class' => 'epl-search-row-half'), array('key' => 'search_bed', 'meta_key' => 'property_bedrooms_max', 'label' => __('Bedrooms Max', 'epl'), 'option_filter' => 'bedrooms_max', 'options' => apply_filters('epl_listing_search_bed_select_max', array_combine(range(1, 10), array_map('epl_number_suffix_callback', range(1, 10)))), 'type' => 'select', 'exclude' => array('land', 'commercial', 'commercial_land', 'business'), 'query' => array('query' => 'meta', 'key' => 'property_bedrooms', 'type' => 'numeric', 'compare' => '<='), 'class' => 'epl-search-row-half'), array('key' => 'search_bath', 'meta_key' => 'property_bathrooms', 'label' => __('Bathrooms', 'epl'), 'option_filter' => 'bathrooms', 'options' => apply_filters('epl_listing_search_bath_select', array_combine(range(1, 3), array_map('epl_number_suffix_callback', range(1, 3)))), 'type' => 'select', 'exclude' => array('land', 'commercial', 'commercial_land', 'business'), 'query' => array('query' => 'meta', 'type' => 'numeric', 'compare' => '>='), 'class' => 'epl-search-row-half'), array('key' => 'search_rooms', 'meta_key' => 'property_rooms', 'label' => __('Rooms', 'epl'), 'option_filter' => 'rooms', 'options' => apply_filters('epl_listing_search_room_select', array_combine(range(1, 3), array_map('epl_number_suffix_callback', range(1, 3)))), 'type' => 'select', 'exclude' => array('land', 'commercial', 'commercial_land', 'business'), 'query' => array('query' => 'meta', 'type' => 'numeric', 'compare' => '>='), 'class' => 'epl-search-row-half'), array('key' => 'search_car', 'meta_key' => 'property_carport', 'label' => __('Car Spaces', 'epl'), 'option_filter' => 'carport', 'options' => apply_filters('epl_listing_search_parking_select', array_combine(range(1, 3), array_map('epl_number_suffix_callback', range(1, 3)))), 'type' => 'select', 'class' => 'epl-search-row-half', 'exclude' => array('land', 'commercial', 'commercial_land', 'business'), 'query' => array('multiple' => true, 'query' => 'meta', 'relation' => 'OR', 'sub_queries' => array(array('key' => 'property_carport', 'type' => 'numeric', 'compare' => '>='), array('key' => 'property_garage', 'type' => 'numeric', 'compare' => '>=')))), array('key' => 'search_land_area', 'meta_key' => 'property_land_area_min', 'label' => __('Land Min', 'epl'), 'type' => has_filter('epl_property_land_area_min') ? apply_filters('epl_property_land_area_min', '') : 'number', 'query' => array('query' => 'meta', 'type' => 'numeric', 'compare' => '>=', 'key' => 'property_land_area'), 'class' => 'epl-search-row-third', 'wrap_start' => 'epl-search-row epl-search-land-area'), array('key' => 'search_land_area', 'meta_key' => 'property_land_area_max', 'label' => __('Land Max', 'epl'), 'class' => 'epl-search-row-third', 'type' => has_filter('epl_property_land_area_max') ? apply_filters('epl_property_land_area_max', '') : 'number', 'query' => array('query' => 'meta', 'type' => 'numeric', 'compare' => '<=', 'key' => 'property_land_area')), array('key' => 'search_land_area', 'meta_key' => 'property_land_area_unit', 'label' => __('Area Unit', 'epl'), 'class' => 'epl-search-row-third', 'type' => 'select', 'option_filter' => 'land_area_unit', 'options' => apply_filters('epl_listing_search_land_unit_label', array('square' => 'Square', 'squareMeter' => 'Square Meter', 'acre' => 'Acre', 'hectare' => 'Hectare', 'sqft' => 'Square Feet')), 'query' => array('query' => 'meta'), 'wrap_end' => true), array('key' => 'search_building_area', 'meta_key' => 'property_building_area_min', 'label' => __('Building Min', 'epl'), 'class' => 'epl-search-row-third', 'type' => has_filter('epl_property_building_area_min') ? apply_filters('epl_property_building_area_min', '') : 'number', 'exclude' => array('land'), 'query' => array('query' => 'meta', 'type' => 'numeric', 'compare' => '>=', 'key' => 'property_building_area'), 'wrap_start' => 'epl-search-row epl-search-building-area'), array('key' => 'search_building_area', 'meta_key' => 'property_building_area_max', 'label' => __('Building Max', 'epl'), 'class' => 'epl-search-row-third', 'type' => has_filter('epl_property_building_area_max') ? apply_filters('epl_property_building_area_max', '') : 'number', 'exclude' => array('land'), 'query' => array('query' => 'meta', 'type' => 'numeric', 'compare' => '<=', 'key' => 'property_building_area')), array('key' => 'search_building_area', 'meta_key' => 'property_building_area_unit', 'label' => __('Area Unit', 'epl'), 'class' => 'epl-search-row-third', 'type' => 'select', 'option_filter' => 'building_area_unit', 'options' => apply_filters('epl_listing_search_building_unit_label', array('square' => 'Square', 'squareMeter' => 'Square Meter', 'acre' => 'Acre', 'hectare' => 'Hectare', 'sqft' => 'Square Feet')), 'exclude' => array('land'), 'query' => array('query' => 'meta'), 'wrap_end' => true), array('key' => 'search_other', 'meta_key' => 'property_air_conditioning', 'label' => __('Air Conditioning', 'epl'), 'type' => 'checkbox', 'exclude' => array('land', 'commercial', 'commercial_land', 'business'), 'query' => array('query' => 'meta', 'compare' => 'IN', 'value' => array('yes', '1')), 'class' => 'epl-search-row-half', 'wrap_start' => 'epl-search-row epl-search-other'), array('key' => 'search_other', 'meta_key' => 'property_pool', 'label' => __('Pool', 'epl'), 'type' => 'checkbox', 'exclude' => array('land', 'commercial', 'commercial_land', 'business'), 'query' => array('query' => 'meta', 'compare' => 'IN', 'value' => array('yes', '1')), 'class' => 'epl-search-row-half'), array('key' => 'search_other', 'meta_key' => 'property_security_system', 'label' => __('Security', 'epl'), 'type' => 'checkbox', 'exclude' => array('land', 'commercial', 'commercial_land', 'business'), 'query' => array('query' => 'meta', 'compare' => 'IN', 'value' => array('yes', '1')), 'class' => 'epl-search-row-half', 'wrap_end' => true)));
    return $fields;
}