Add US geo data tables, filter bounds API, and URL hash state management
- Add mls_geo_cities and mls_geo_zipcodes tables with 29,880 cities and 33,144 zip codes - Add get_filter_bounds() method to reposition map when filters don't intersect current view - Move all URL state (filters, page, scroll, map position) to hash to avoid WordPress 404s - Add filter bounds AJAX endpoint for map repositioning on filter change Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,8 @@ define('MLS_TABLE_SYNC_STATE', 'mls_sync_state');
|
||||
define('MLS_TABLE_RATE_LIMITS', 'mls_rate_limits');
|
||||
define('MLS_TABLE_SYNC_LOG', 'mls_sync_log');
|
||||
define('MLS_TABLE_MEDIA_LOG', 'mls_media_log');
|
||||
define('MLS_TABLE_GEO_CITIES', 'mls_geo_cities');
|
||||
define('MLS_TABLE_GEO_ZIPCODES', 'mls_geo_zipcodes');
|
||||
|
||||
// HomeProz office MLS ID for identifying our listings
|
||||
define('MLS_HOMEPROZ_OFFICE_ID', 'NST253235');
|
||||
@@ -390,6 +392,20 @@ function mls_get_property_count($args = array()) {
|
||||
return $plugin->get_query()->get_count($args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get geographic bounds for filtered properties
|
||||
*
|
||||
* @param array $args Filter arguments
|
||||
* @return array|null Bounds with sw_lat, sw_lng, ne_lat, ne_lng
|
||||
*/
|
||||
function mls_get_filter_bounds($args = array()) {
|
||||
$plugin = mls_plugin();
|
||||
if (!$plugin->get_query()) {
|
||||
return null;
|
||||
}
|
||||
return $plugin->get_query()->get_filter_bounds($args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all images for a listing (on-demand fetching)
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user