Created
September 8, 2025 10:26
-
-
Save propertyhive/28d9323de3cdcdb3f2183ebc33e218be 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( '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