1. Home
  2. Docs
  3. Add-Ons
  4. Property Import
  5. Importing Bespoke BLM Fields

Importing Bespoke BLM Fields

There are times when importing a BLM that the data provider will add custom fields that aren't part of the original BLM specification.

Importing these fields is easy enough and can be achieved in just 2 steps:

1: Add the custom field to Property Hive

Using our free Template Assistant add on you can add custom fields to Property Hive. Once installed and activated, navigate to 'Property Hive > Settings > Template Assistant' and add the field(s) in question.

2: Import the field

Add the following to your themes functions.php file:

add_action( "propertyhive_property_imported_blm", "import_custom_blm_field", 10, 2);
function import_custom_blm_field( $post_id, $property )
{
    if ( isset($property['CUSTOM_FIELD_NAME_IN_BLM']) )
    {
        update_post_meta($post_id, '_custom_field_name_in_hive', $property['CUSTOM_FIELD_NAME_IN_BLM']);
    }
}

Switch out the field names in the above snippet with the column name from the BLM and the custom field name you set up in step 1. The next time an import runs this new custom field should then get populated.

Note: Custom field names in Property Hive are always lowercase and begin with an underscore. So your name your field 'Directions', the custom field needed to be entered above would be '_directions'.

Was this article helpful to you? No 1 Yes

How can we help?