Search stores (custom postcode field) within 5, 10, 15 miles of user inputted postcode.. Code modification

There has been a number of questions and answers on this site regarding returning results based on Geo Location.

Please take a look at the following posts:

Is it possible to wrap Geo Location search around WP_Query?

Optimizing a Proximity-based Store Location Search on a Shared Web Host?

How can I implement a location based (zip code) search in WordPress?

I have geocoded posts with latitude longitude – How to search by radius?

Also please take a look at my plugin: Geo Data Store which I built due to the need for storing geo data in a more optimised fashion than what WordPress does out of the box. You save your coordinates in a custom field of your choice, tell the plugin which field that is by using a filter and then that custom field is copied into a table optimized for radius searching.

The plugin then gives you a couple of functions you can use to return post ID’s that are in a given radius of a point, which you can then use the post ID’s in a WP_Query or pre_get_posts.