Skip to content

Instantly share code, notes, and snippets.

@zackkatz
Created June 16, 2024 22:46
Show Gist options
  • Save zackkatz/8b37dc92c0f33f61469398e4d2b17c88 to your computer and use it in GitHub Desktop.
Save zackkatz/8b37dc92c0f33f61469398e4d2b17c88 to your computer and use it in GitHub Desktop.
GravityView Maps - Add more radius search options
<?php
/**
* Add larger-radius options for geolocation radius search.
*
* @param array $options Nested array. `value` key maps to the size of the radius.
*
* @return array Modified array of options.
*/
add_filter( 'gk/gravitymaps/geolocation_radius_options', function ( $options ) {
$additional_options = [
[ 'value' => 200 ],
[ 'value' => 300 ],
[ 'value' => 400 ],
[ 'value' => 500 ],
[ 'value' => 750 ],
[ 'value' => 1000 ],
];
return array_merge( $options, $additional_options );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment