Skip to content

Instantly share code, notes, and snippets.

@g-maclean
Created December 23, 2025 03:50
Show Gist options
  • Select an option

  • Save g-maclean/45937f247bdc47fad808bfaf971d42e7 to your computer and use it in GitHub Desktop.

Select an option

Save g-maclean/45937f247bdc47fad808bfaf971d42e7 to your computer and use it in GitHub Desktop.
Property Hive - Import Retirement property and furnishing
add_action( "propertyhive_property_imported_street_json", 'import_furnished_and_type', 10, 2 );
function import_furnished_and_type( $post_id, $property ) {
//furnished
if ( isset( $property['lettingsListing']['furnished'] ) && !empty( $property['lettingsListing']['furnished'] ) ) {
$furnished = sanitize_text_field( $property['lettingsListing']['furnished'] );
$allowed_values = array( 'Furnished', 'Unfurnished', 'Part Furnished' );
if ( in_array( $furnished, $allowed_values ) ) {
wp_set_object_terms( $post_id, $furnished, 'furnished' );
}
}
//type Retirement Property
if ( isset( $property['attributes']['property_type'] ) ) {
$type = $property['attributes']['property_type'];
if ( $type == 'Retirement Property' ) {
wp_set_object_terms( $post_id, 'Retirement Property', 'property_type' );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment