Created
January 27, 2026 15:56
-
-
Save propertyhive/e40f3423dc979d631da9510db4bc4e59 to your computer and use it in GitHub Desktop.
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( "houzez_property_feed_property_imported_kyero", 'import_custom_plans_node', 10, 4 ); | |
| function import_custom_plans_node($post_id, $property, $import_id, $instance_id) | |
| { | |
| $floorplans = array(); | |
| if (isset($property->plans) && !empty($property->plans)) | |
| { | |
| foreach ($property->plans as $plans) | |
| { | |
| if (!empty($plans->plan)) | |
| { | |
| foreach ($plans->plan as $plan) | |
| { | |
| if ( | |
| substr( strtolower((string)$plan->url), 0, 2 ) == '//' || | |
| substr( strtolower((string)$plan->url), 0, 4 ) == 'http' | |
| ) | |
| { | |
| $floorplans[] = array( | |
| "fave_plan_title" => __( 'Floorplan', 'houzezpropertyfeed' ), | |
| "fave_plan_image" => trim((string)$plan->url) | |
| ); | |
| } | |
| } | |
| } | |
| } | |
| } | |
| if ( !empty($floorplans) ) | |
| { | |
| update_post_meta( $post_id, 'floor_plans', $floorplans ); | |
| update_post_meta( $post_id, 'fave_floor_plans_enable', 'enable' ); | |
| } | |
| else | |
| { | |
| update_post_meta( $post_id, 'fave_floor_plans_enable', 'disable' ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment