Created
April 27, 2022 09:54
-
-
Save hivepress/60359efea8625760d5c63798e4307124 to your computer and use it in GitHub Desktop.
Make the location field optional for listings #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/models/listing/attributes', | |
function( $attributes ) { | |
if ( isset( $attributes['location'] ) ) { | |
$attributes['location']['edit_field']['required'] = false; | |
} | |
return $attributes; | |
}, | |
1000 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can it be made optional depending on the selected category instead of globally?