Last active
April 11, 2023 20:48
-
-
Save hivepress/9867bf3676a74317014cdddfd2e83c4b to your computer and use it in GitHub Desktop.
Change the Location field placeholder in the listing search form #hivepress #geolocation
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
<?php | |
add_filter( | |
'hivepress/v1/forms/listing_search', | |
function( $form ) { | |
if ( isset( $form['fields']['location'] ) ) { | |
$form['fields']['location']['placeholder'] = 'custom text here'; | |
} | |
return $form; | |
}, | |
1000 | |
); |
Yes, but instead of Geolocation you'd have to use a manually created Select attribute. Please note that Geolocation also adds useful features like radius-based search.
Okay, thank you for your prompt response.
I have created the custom attribute, how do I add it to the search bar?
Please try using our forum if there are any other issues https://community.hivepress.io/ Thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for this. Is there a way I can make the location field a drop down menu just like the way "all categories" shows a drop down?