Custom Search Form Details (wpCasa)
<?php
/**
* Custom Search Form Details (wpCasa)
*/
add_filter('wpsight_search_form_details', 'wps27_search_form_details', 100);
function wps27_search_form_details() {
$standard_details = wpsight_standard_details();
$search_details = array(
'status' => array(
'label' => __( 'Status', 'wpsight' ),
'key' => '_price_status',
'data' => wpsight_listing_statuses(),
'type' => 'select',
'data_compare' => '=',
'data_type' => false,
'default' => false,
'advanced' => false,
'position' => 10
),
'location' => array(
'label' => __( 'Location', 'wpsight' ),
'taxonomy' => 'location',
'data' => get_terms( 'location', array( 'orderby' => 'name', 'hide_empty' => true ) ),
'type' => 'taxonomy',
'data_compare' => false,
'data_type' => false,
'default' => false,
'advanced' => false,
'position' => 20
),
'property-type' => array(
'label' => __( 'Type', 'wpsight' ),
'taxonomy' => 'property-type',
'data' => get_terms( 'property-type', array( 'orderby' => 'name', 'hide_empty' => true ) ),
'type' => 'taxonomy',
'data_compare' => false,
'data_type' => false,
'default' => false,
'advanced' => false,
'position' => 30
),
$standard_details['details_1']['id'] => array(
'label' => $standard_details['details_1']['label'],
'key' => '_details_1',
'type' => 'text',
'data_compare' => '=',
'data_type' => false,
'default' => false,
'advanced' => false,
'position' => 40
),
$standard_details['details_2']['id'] => array(
'label' => $standard_details['details_2']['label'],
'key' => '_details_2',
'type' => 'text',
'data_compare' => '=',
'data_type' => false,
'default' => false,
'advanced' => false,
'position' => 50
),
'min' => array(
'label' => __( 'Price (min)', 'wpsight' ),
'key' => '_price',
'type' => 'text',
'data_compare' => '>=',
'data_type' => 'numeric',
'default' => false,
'advanced' => true,
'position' => 60
),
'max' => array(
'label' => __( 'Price (max)', 'wpsight' ),
'key' => '_price',
'type' => 'text',
'data_compare' => '<=',
'data_type' => 'numeric',
'default' => false,
'advanced' => true,
'position' => 70
),
'orderby' => array(
'label' => __( 'Order by', 'wpsight' ),
'key' => false,
'data_compare' => false,
'data_type' => false,
'type' => 'radio',
'data' => array(
'date' => __( 'Date', 'wpsight' ),
'price' => __( 'Price', 'wpsight' ),
'title' => __( 'Title', 'wpsight' )
),
'default' => 'date',
'advanced' => true,
'position' => 80
),
'order' => array(
'label' => __( 'Order', 'wpsight' ),
'key' => false,
'data_compare' => false,
'data_type' => false,
'type' => 'radio',
'data' => array(
'asc' => __( 'asc', 'wpsight' ),
'desc' => __( 'desc', 'wpsight' )
),
'default' => 'desc',
'advanced' => true,
'position' => 90
)
);
return $search_details;
}