Last active
April 20, 2026 19:01
-
-
Save g-maclean/c5e423bbd42c8a1bb505a9a9d944d044 to your computer and use it in GitHub Desktop.
Property Hive - rightmove - add floor area (for residential)
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_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