Skip to content

Instantly share code, notes, and snippets.

@JoeHana
Created December 5, 2018 17:17
Show Gist options
  • Save JoeHana/7e2b72af8fdebeb71ffb3f5f026cd7f7 to your computer and use it in GitHub Desktop.
Save JoeHana/7e2b72af8fdebeb71ffb3f5f026cd7f7 to your computer and use it in GitHub Desktop.
Remove 'Details 1' and 'Details 2' from property search form in WPCasa
<?php
/**
* Remove 'Details 1' and 'Details 2' from property search form in WPCasa
*
* @param array Registered search fields
* @uses wpsight_details()
* @return array
*/
add_filter( 'wpsight_get_search_fields', 'custom_wpsight_get_search_fields' );
function custom_wpsight_get_search_fields( $fields ) {
// Get listing details
$details = wpsight_details();
$details_1 = $details['details_1']['id'];
$details_2 = $details['details_2']['id'];
// Unset details_1 and details_2
unset( $fields[ $details_1 ] );
unset( $fields[ $details_2 ] );
// Adjust the width of the other fields in the same row.
$fields['offer']['class'] = 'col-xs-12 col-sm-4';
$fields['location']['class'] = 'col-xs-12 col-sm-4';
$fields['listing-type']['class'] = 'col-xs-12 col-sm-4';
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment