Skip to main content
Property Hive Intergration
Mike Avery avatar
Written by Mike Avery
Updated over 3 years ago

Useful pages

Standard import to website option:

Add auto inbound enquiries

Ways to add extra customisation / fields to the feed:

One is to import additional data into custom fields
The other is to customise the fields used in descriptions

// Import AI field into custom field added using our free Template Assistant add on
add_action( "propertyhive_property_imported_agentsinsight_xml", 'import_custom_field', 10, 2 );
function import_custom_field($post_id, $property)
{
update_post_meta( $post_id, '_url', (string)$property->url );
}

// Customise the fields used in the AI import
add_action( "propertyhive_property_imported_agentsinsight_xml", 'customise_description_fields', 10, 2 );
function customise_description_fields( $post_id, $property )
{
$description_i = 0;

if ( isset($property->specification_description) && (string)$property->specification_description != '' )
{
update_post_meta( $post_id, '_description_name_' . $description_i, '' );
update_post_meta( $post_id, '_description_' . $description_i, (string)$property->specification_description );

++$description_i;
}
if ( isset($property->location) && (string)$property->location != '' )
{
update_post_meta( $post_id, '_description_name_' . $description_i, 'Location' );
update_post_meta( $post_id, '_description_' . $description_i, (string)$property->location );

++$description_i;
}
if ( isset($property->marketing_text_1) && (string)$property->marketing_text_1 != '' )
{
update_post_meta( $post_id, '_description_name_' . $description_i, (string)$property->marketing_title_1 );
update_post_meta( $post_id, '_description_' . $description_i, (string)$property->marketing_text_1 );

++$description_i;
}
if ( isset($property->marketing_text_2) && (string)$property->marketing_text_2 != '' )
{
update_post_meta( $post_id, '_description_name_' . $description_i, (string)$property->marketing_title_2 );
update_post_meta( $post_id, '_description_' . $description_i, (string)$property->marketing_text_2 );

++$description_i;
}
if ( isset($property->marketing_text_3) && (string)$property->marketing_text_3 != '' )
{
update_post_meta( $post_id, '_description_name_' . $description_i, (string)$property->marketing_title_3 );
update_post_meta( $post_id, '_description_' . $description_i, (string)$property->marketing_text_3 );

++$description_i;
}
if ( isset($property->marketing_text_4) && (string)$property->marketing_text_4 != '' )
{
update_post_meta( $post_id, '_description_name_' . $description_i, (string)$property->marketing_title_4 );
update_post_meta( $post_id, '_description_' . $description_i, (string)$property->marketing_text_4 );

++$description_i;
}
if ( isset($property->marketing_text_5) && (string)$property->marketing_text_5 != '' )
{
update_post_meta( $post_id, '_description_name_' . $description_i, (string)$property->marketing_title_5 );
update_post_meta( $post_id, '_description_' . $description_i, (string)$property->marketing_text_5 );

++$description_i;
}
if ( isset($property->marketing_text_transport) && (string)$property->marketing_text_transport != '' )
{
update_post_meta( $post_id, '_description_name_' . $description_i, (string)$property->marketing_title_transport );
update_post_meta( $post_id, '_description_' . $description_i, (string)$property->marketing_text_transport );

++$description_i;
}
update_post_meta( $post_id, '_descriptions', $description_i );
}

Did this answer your question?