Remove 'Offer' from property search form in WPCasa (WPCasa Madrid, WPCasa Oslo, WPCasa London
<?php
/**
* Remove 'Offer' from property search form in WPCasa
* for Twitter's Bootstrap-based themes (WPCasa Madrid, WPCasa Oslo, WPCasa London)
*
* @param array Registered search fields
* @uses wpsight_details()
* @return array
*/
add_filter( 'wpsight_get_search_fields', 'wpsight_get_search_fields_offer_remove' );
function wpsight_get_search_fields_offer_remove( $fields ) {
// Unset offer
unset( $fields['offer'] );
/**
* As we removed a field, we need to adjust the width
* of the other fields in the same row.
*/
// Get listing details
$details = wpsight_details();
$details_1 = $details['details_1']['id'];
$details_2 = $details['details_2']['id'];
$fields['location']['class'] = 'col-xs-12 col-sm-3';
$fields['listing-type']['class'] = 'col-xs-12 col-sm-3';
$fields[ $details_1 ]['class'] = 'col-xs-12 col-sm-3';
$fields[ $details_2 ]['class'] = 'col-xs-12 col-sm-3';
return $fields;
}