10ninety

Setting up an import from 10ninety

This page contains information specific to 10ninety. For a general guide on setting up a property import, please see our 'Creating your first property import' guide.

When creating an import from 10ninety, you'll be presented with the following fields:

XML URL - You will need to obtain your XML URL directly from 10ninety.

Only import updated properties - To ensure feeds run quicker and more efficiently you can tick this option to only import properties that have changed since the last time an import ran.

Developer hooks

Hook name: propertyhive_pre_import_properties_10ninety_xml

Hook type: Action

Description: Executed after the properties are parsed but before they are actually imported.

Example usage:

add_action( 'propertyhive_pre_import_properties_10ninety_xml', 'pre_import' );
function pre_import( $properties )
{
     // $properties (array) - Array of SimpleXML objects containing property data sent by 10ninety

    // do something here...
}

Hook name: propertyhive_10ninety_xml_properties_due_import

Hook type: Filter

Description: Executed after the properties are parsed but before actually being imported. Allows you to filter out any properties you don't want to import.

For example, maybe you want to only import properties belonging to a certain office.

Example usage:

add_filter( 'propertyhive_10ninety_xml_properties_due_import', 'filter_properties' );
function filter_properties( $properties )
{
    // $properties (array) - Array of SimpleXML objects containing property data sent by 10ninety

    $new_properties = array();
    
    foreach ($properties as $property)
    {
        if ( isset($property->BRANCH_ID) && (string)$property->BRANCH_ID == '12345' )
        {
            $new_properties[] = $property;
        }
    }
    return $new_properties;
}

Hook name: propertyhive_10ninety_xml_address_fields_to_check

Hook type: Filter

Description: If you have locations setup under 'Property Hive > Settings > Custom Fields' we'll look at a number of address fields provided in the 10ninety data and, if a matching 'Location' is found, we'll set it accordingly.

Using this filter you can customise the address fields in the 10ninety XML file that we consider when looking for a matching location.

Example usage:

add_filter( 'propertyhive_10ninety_xml_address_fields_to_check', 'customise_address_fields' );
function customise_address_fields($address_fields)
{
    // $address_fields (array) - defaults to ['ADDRESS_2', 'ADDRESS_3', 'TOWN', 'ADDRESS_4', 'COUNTY']

    $address_fields[] = 'ADDRESS_1'; // also look at address line 1 when mapping to location

    return $address_fields;
}

Hook name: propertyhive_property_imported_10ninety_xml

Hook type: Action

Description: Executed after each individual property is imported.

Example usage:

add_action( 'propertyhive_property_imported_10ninety_xml', 'property_imported', 10, 2 );
function property_imported( $post_id, $property )
{
    // $post_id (int) - the WordPress post ID of the imported property
    // $property (SimpleXML object) - The property received from 10ninety

    // do something here...
}

Hook name: propertyhive_post_import_properties_10ninety_xml

Hook type: Action

Description: Executed after all properties have been imported.

Example usage:

add_action( 'propertyhive_post_import_properties_10ninety_xml', 'post_import' );
function post_import()
{
    // do something here...
}

Hook name: propertyhive_property_removed_10ninety_xml

Hook type: Action

Description: Executed after a property has been removed from Property Hive due to it not being present in the feed.

Example usage:

add_action( 'propertyhive_property_removed_10ninety_xml', 'property_removed' );
function property_removed( $post_id )
{
    // $post_id (int) - the WordPress post ID of the imported property

    // do something here...
}