Created
February 20, 2023 21:17
-
-
Save hivepress/e516899262d31d83f2b9d907bf36ebd9 to your computer and use it in GitHub Desktop.
Make the location field required 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']['required'] = true; | |
} | |
return $form; | |
}, | |
1000 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment