Skip to content

Instantly share code, notes, and snippets.

@g-maclean
Created August 26, 2025 09:24
Show Gist options
  • Save g-maclean/d44a262dd91c8e7e9270dfd9c6115a2f to your computer and use it in GitHub Desktop.
Save g-maclean/d44a262dd91c8e7e9270dfd9c6115a2f to your computer and use it in GitHub Desktop.
Property Hive - MRI Thesauraus - Import interactive floorplan
add_action( "propertyhive_property_imported_thesaurus_xml", 'import_interactive_floorplan', 10, 2 );
function import_interactive_floorplan($post_id, $property)
{
$virtual_tours = array();
for ($i = 245; $i <= 247; ++$i)
{
if (
$property[$i] != '' &&
(
strpos(strtolower($property[$i]), 'metropix') !== FALSE
)
)
{
$interactive_floorplan = array(
'url' => $property[$i],
'label' => $property[$i - 3]
);
}
}
update_post_meta( $post_id, '_interactive_floorplan', (string)$interactive_floorplan['url'] );
update_post_meta( $post_id, '_interactive_floorplan_label', (string)$$interactive_floorplan['label'] );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment