Skip to content

Instantly share code, notes, and snippets.

@propertyhive
Created January 27, 2026 15:56
Show Gist options
  • Select an option

  • Save propertyhive/e40f3423dc979d631da9510db4bc4e59 to your computer and use it in GitHub Desktop.

Select an option

Save propertyhive/e40f3423dc979d631da9510db4bc4e59 to your computer and use it in GitHub Desktop.
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