Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save propertyhive/d585d8a5659460e541d2deab0286b96c to your computer and use it in GitHub Desktop.
Save propertyhive/d585d8a5659460e541d2deab0286b96c to your computer and use it in GitHub Desktop.
add_action( "houzez_property_feed_property_imported_street", 'convert_sq_m_to_sq_ft', 10, 4 );
function convert_sq_m_to_sq_ft( $post_id, $property, $import_id, $instance_id )
{
if ( isset($property['attributes']['floor_area']) && !empty($property['attributes']['floor_area']) )
{
$floor_area = $property['attributes']['floor_area'];
// convert
$floor_area = $floor_area * 10.764;
update_post_meta( $post_id, 'fave_property_size', $floor_area );
update_post_meta( $post_id, 'fave_property_size_prefix', 'Sq Ft' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment