Skip to content

Instantly share code, notes, and snippets.

@g-maclean
Created March 10, 2025 15:49
Show Gist options
  • Save g-maclean/34529073472103e29767087af3de54d4 to your computer and use it in GitHub Desktop.
Save g-maclean/34529073472103e29767087af3de54d4 to your computer and use it in GitHub Desktop.
ProeprtyHive - Reapit Foundations filter properties by Reapit office ID on import
add_filter( "propertyhive_reapit_foundations_json_properties_due_import", 'remove_non_auction_properties' );
function remove_non_auction_properties( $properties )
{
$office_ids = array( 1, 2, 3 );
$new_properties = array();
foreach ( $properties as $property )
{
if ( isset( $property['officeIds'] ) && is_array( $property['officeIds'] ) && count( $property['officeIds'] ) > 0 )
{
if(in_array($property['officeIds'][0], $office_ids))
{
$new_properties[] = $property;
}
}
}
return $new_properties;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment