Created
March 27, 2025 17:02
-
-
Save g-maclean/01ad25b2fa4a12f3471d2bc7aebd4768 to your computer and use it in GitHub Desktop.
PropertyHive - Foundations - Import BER
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_reapit_foundations_json", 'import_ber_foundations', 10, 2 ); | |
function import_ber_foundations( $post_id, $property ) | |
{ | |
$rating = isset( $property['regional']['irl']['buildingEnergyRating']['rating'] ) ? $property['regional']['irl']['buildingEnergyRating']['rating'] : ''; | |
$ber_id = isset( $property['regional']['irl']['buildingEnergyRating']['refNumber'] ) ? $property['regional']['irl']['buildingEnergyRating']['refNumber'] : ''; | |
update_post_meta( $post_id, '_ber_rating', $rating ); | |
update_post_meta( $post_id, '_ber_id', $ber_id ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment