How to alter the RecPress location radius options

By default the location filter in RecPress allow the user to select a radius. This will return any jobs that are with that radius of the location they choose.

The default options for select a radius are 10, 25, 50, 75, 100 and 200 miles, with the default radius being 50 miles.

If you would like to amend these, you can do so by using the facetwp_facets filter. Here is an example.

<?php
/**
 * Edits the location radius options.
 *
 * @param  array $facets The facets.
 * @return array $facets The modified facets array.
 */
function hd_edit_recpress_location_radius_options( $facets ) {

	// if we don't have a location radius facet, bail.
	if ( empty( $facets['location_radius'] ) ) {
		return $facets;
	}

	// edit the radius facet options.
	$facets['location_radius']['radius_options'] = '10, 20, 50, 1000';

	// set the radius default.
	$facets['location_radius']['radius_default'] = '10';

	// return the facets.
	return $facets;

}

add_filter( 'facetwp_facets', 'hd_edit_recpress_location_radius_options', 20, 1 );