Created
December 23, 2025 03:50
-
-
Save g-maclean/45937f247bdc47fad808bfaf971d42e7 to your computer and use it in GitHub Desktop.
Property Hive - Import Retirement property and furnishing
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_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