Skip to content

Instantly share code, notes, and snippets.

@g-maclean
Last active April 20, 2026 19:01
Show Gist options
  • Select an option

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

Select an option

Save g-maclean/c5e423bbd42c8a1bb505a9a9d944d044 to your computer and use it in GitHub Desktop.
Property Hive - rightmove - add floor area (for residential)
add_filter( 'ph_rtdf_send_request_data', 'amend_property_request_data', 10, 2 );
function amend_property_request_data( $request_data, $post_id )
{
$floor_area_raw = get_post_meta($post_id, '_floor_area', true);
if ( !empty($floor_area_raw) )
{
// Remove anything that isn't a number or decimal point
$floor_area = preg_replace('/[^0-9.]/', '', $floor_area_raw);
if ( is_numeric($floor_area) )
{
$request_data['property']['details']['Internal_Area'] = (float) $floor_area;
$request_data['property']['details']['Internal_Area_Unit'] = 'ft';
}
}
return $request_data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment