Skip to content

Instantly share code, notes, and snippets.

@JoeHana
Created July 22, 2017 16:12
Show Gist options
  • Save JoeHana/cae80ae104df372adfdbf74d64c3716c to your computer and use it in GitHub Desktop.
Save JoeHana/cae80ae104df372adfdbf74d64c3716c to your computer and use it in GitHub Desktop.
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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment