Created
August 26, 2025 09:24
-
-
Save g-maclean/d44a262dd91c8e7e9270dfd9c6115a2f to your computer and use it in GitHub Desktop.
Property Hive - MRI Thesauraus - Import interactive floorplan
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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