Skip to content

Instantly share code, notes, and snippets.

@propertyhive
Created September 8, 2025 10:26
Show Gist options
  • Save propertyhive/28d9323de3cdcdb3f2183ebc33e218be to your computer and use it in GitHub Desktop.
Save propertyhive/28d9323de3cdcdb3f2183ebc33e218be to your computer and use it in GitHub Desktop.
add_action( 'propertyhive_property_imported_kyero_xml', 'use_nl_description_and_custom_title', 10, 2 );
function use_nl_description_and_custom_title( $post_id, $property ) {
if ( $property->type->en )
{
$property_type = (string)$property->type->en;
}
else
{
$property_type = (string)$property->type;
}
if (empty($property_type)) { $property_type = 'villa'; }
$display_address = (string)$property->location_detail;
if ( $display_address == '' )
{
$display_address = (string)$property->town;
}
if ( $display_address == '' )
{
$display_address = (string)$property->province;
}
$post_title = (string)$property->beds . ' bed ' . $property_type . ' in ' . $display_address;
$desc = (string)$property->desc->nl;
$post = array(
'ID' => $post_id,
'post_title' => $post_title,
'post_excerpt' => $desc,
);
wp_update_post( $post );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment