Manual property enhancements: MLS status sync, agent clone, description formatting

- Manual properties linked to MLS now inherit status (Active/Pending/Closed) and
  days_on_market from the MLS listing dynamically
- Properties not in MLS default to Closed status
- Clone feature now auto-populates listing agent by matching MLS ID to Agent CPT
- Description formatter detects embedded headers (unpunctuated text after sentences)
  and splits them into separate paragraphs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
root
2026-01-23 21:28:44 +00:00
parent c2d5b2248d
commit 57b752f54e
60 changed files with 5323 additions and 189 deletions
@@ -250,7 +250,8 @@ class MLS_Cluster {
// Build WHERE clause
// Exclude properties with invalid coordinates from map display
$where = array('mlg_can_view = 1', 'latitude IS NOT NULL', 'longitude IS NOT NULL', 'coordinates_invalid = 0');
// Also exclude properties with no price or price < 100 (invalid data)
$where = array('mlg_can_view = 1', 'latitude IS NOT NULL', 'longitude IS NOT NULL', 'coordinates_invalid = 0', 'list_price >= 100');
$values = array();
// Add state filter (MN, IA only)
@@ -484,6 +485,11 @@ class MLS_Cluster {
$street = implode(' ', $address_parts);
$full_address = $street ? $street . ', ' . $property->city : $property->city;
// Get image URL with signature
$image_url = function_exists('mls_get_image_url')
? mls_get_image_url($property->listing_key, 1, 'thumb')
: '';
$markers[] = array(
'id' => $property->listing_key,
'lat' => (float) $property->latitude,
@@ -495,6 +501,7 @@ class MLS_Cluster {
'baths' => $property->bathrooms_total,
'sqft' => $property->living_area,
'status' => $property->standard_status,
'image' => $image_url,
);
}
@@ -572,8 +579,8 @@ class MLS_Cluster {
global $wpdb;
$table = $this->db->properties_table();
// Exclude properties with invalid coordinates
$where = array('mlg_can_view = 1', 'latitude IS NOT NULL', 'longitude IS NOT NULL', 'coordinates_invalid = 0');
// Exclude properties with invalid coordinates or invalid price
$where = array('mlg_can_view = 1', 'latitude IS NOT NULL', 'longitude IS NOT NULL', 'coordinates_invalid = 0', 'list_price >= 100');
$values = array();
// Add state filter (MN, IA only)