Skip to content

Instantly share code, notes, and snippets.

@propertyhive
Last active February 15, 2026 13:26
Show Gist options
  • Select an option

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

Select an option

Save propertyhive/46bf8e57fe8c17b34f728adfec5339f2 to your computer and use it in GitHub Desktop.
add_action( "propertyhive_sturents_v2_property_imported", 'hardcode_title_and_to_eur', 10, 2 );
function hardcode_title_and_to_eur($post_id, $property)
{
// Set title to room type
$my_post = array(
'ID' => $post_id,
'post_title' => wp_strip_all_tags( $property['room_type'] ),
'post_excerpt' => $property['description'],
'post_content' => '',
'post_status' => 'publish',
);
wp_update_post( $my_post );
// Set currency
update_post_meta($post_id, '_currency', 'EUR');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment