Created
December 15, 2025 20:13
-
-
Save g-maclean/e329997fed05893fc97d299a3e3b5d7b to your computer and use it in GitHub Desktop.
Property Hive - Agency Pilot - Import all commercial
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( "propertyhive_agency_pilot_api_request_body", 'include_completed_in_body' ); | |
| function include_completed_in_body($body) | |
| { | |
| $body['FilterOptions']['ActiveOnly'] = false; | |
| return $body; | |
| } | |
| add_filter( "propertyhive_agency_pilot_api_properties_due_import", 'filter_completed', 10, 3 ); | |
| function filter_completed($properties, $options, $token) | |
| { | |
| $new_properties = array(); | |
| foreach ( $properties as $property ) | |
| { | |
| if ( | |
| //$property['MarketStatus']['ID'] == 3 || // Comparable | |
| $property['MarketStatus']['ID'] == 4 || // Sold | |
| $property['MarketStatus']['ID'] == 5 || // Let | |
| $property['MarketStatus']['ID'] == 6 || // Sold Subject to Contract | |
| //$property['MarketStatus']['ID'] == 7 || // Under Development | |
| $property['MarketStatus']['ID'] == 8 || // Under Offer | |
| $property['MarketStatus']['ID'] == 14 || // Available | |
| //$property['MarketStatus']['ID'] == 15 || // Withdrawn | |
| //$property['MarketStatus']['ID'] == 16 || // Pending | |
| //$property['MarketStatus']['ID'] == 17 || // Professional | |
| $property['MarketStatus']['ID'] == 18 || // For Sale | |
| $property['MarketStatus']['ID'] == 19 // To Let | |
| ) | |
| { | |
| $new_properties[] = $property; | |
| } | |
| } | |
| return $new_properties; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment