Created
November 23, 2022 11:26
-
-
Save propertyhive/b978b1d1664bbcda592fc0789e8fbff4 to your computer and use it in GitHub Desktop.
This file contains 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_vebra_api_xml", 'set_alto_area', 10, 2 ); | |
function set_alto_area( $post_id, $property ) | |
{ | |
update_post_meta( $post_id, '_area_max', '' ); | |
if ( isset($property->area->max) && !empty((string)$property->area->max) ) | |
{ | |
update_post_meta( $post_id, '_area_max', (string)$property->area->max ); | |
} | |
else | |
{ | |
if ( isset($property->area->min) && !empty((string)$property->area->min) ) | |
{ | |
update_post_meta( $post_id, '_area_max', (string)$property->area->min ); | |
} | |
} | |
} | |
add_action( "propertyhive_realhomes_property_synced", 'set_rh_area', 10, 3 ); | |
function set_rh_area( $property_id, $post_id, $synced ) | |
{ | |
if ( $synced ) | |
{ | |
$property = new PH_Property($property_id); | |
update_post_meta( $post_id, 'REAL_HOMES_property_size', $property->_area_max ); | |
update_post_meta( $post_id, 'REAL_HOMES_property_size_postfix', 'sq ft' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment