-
-
Save propertyhive/6a79ac0117410244ecd3 to your computer and use it in GitHub Desktop.
Add location field to PropertyHive search form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'propertyhive_search_form_fields_default', 'update_ph_search_form_fields', 10, 1 ); | |
function update_ph_search_form_fields($fields) | |
{ | |
$department_field = $fields['department']; | |
unset( $fields['department'] ); | |
$fields = array_reverse($fields, true); | |
$fields['address_keyword'] = array( | |
'type' => 'text', | |
'label' => __( 'Location', 'propertyhive' ), | |
'before' => '<div class="control control-address_keyword">', | |
'placeholder' => __( 'Enter Location', 'propertyhive' ), | |
); | |
$fields['department'] = $department_field; | |
$fields = array_reverse($fields, true); | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment