Skip to content

Instantly share code, notes, and snippets.

@g-maclean
Last active May 5, 2026 07:34
Show Gist options
  • Select an option

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

Select an option

Save g-maclean/e55a13cb1bcb916d814530e5e14f81d1 to your computer and use it in GitHub Desktop.
Property Hive - Real time feed - override To Rent price qualifier
add_filter( 'ph_rtdf_send_request_data', 'set_price_qualifier_for_commercial_rent', 10, 2 );
function set_price_qualifier_for_commercial_rent( $request_data, $post_id ) {
$property = new PH_Property( $post_id );
if ( ! $property ) {
return $request_data;
}
$original_department = $property->department;
// Check if department is commercial
if (
$original_department === 'commercial' ||
ph_get_custom_department_based_on( $original_department ) === 'commercial'
) {
// Check if property is to rent
if ( $property->to_rent === 'yes' ) {
if ( isset( $request_data['property']['price_information']['price_qualifier'] ) ) {
unset( $request_data['property']['price_information']['price_qualifier'] );
}
}
}
return $request_data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment