Skip to content

Instantly share code, notes, and snippets.

@propertyhive
propertyhive / gist:5e3c3f0d2aae9d80fa9d91f747cd4824
Created May 18, 2026 11:17
Set EPC certificate ID in RTDF requests
add_filter( 'ph_rtdf_send_request_data', 'set_rtdf_epc_certificate_id', 10, 2 );
function set_rtdf_epc_certificate_id( $request_data, $post_id )
{
$epc_certificate_id = get_post_meta($post_id, '_epc_certificate_id', true);
if ( !empty($epc_certificate_id) )
{
$request_data['property']['details']['epc_information'] = array(
'epc_certificate_id' => trim($epc_certificate_id)
);
}
add_filter( 'propertyhive_reapit_foundations_enquiry_body', 'split_name_in_reapit_enquiry', 10, 1 );
function split_name_in_reapit_enquiry($body)
{
if ( isset($_POST['first_name']) && !empty($_POST['first_name']) )
{
$body['forename'] = sanitize_text_field($_POST['first_name']);
}
if ( isset($_POST['last_name']) && !empty($_POST['last_name']) )
{
@propertyhive
propertyhive / snippet.php
Last active May 5, 2026 07:46 — forked from g-maclean/snippet.php
Property Hive - Real time feed - override To Rent price qualifier
add_filter( 'ph_rtdf_send_request_data', 'set_price_qualifier_for_commercial_rent_rtdf', 10, 2 );
function set_price_qualifier_for_commercial_rent_rtdf( $request_data, $post_id )
{
$property = new PH_Property( $post_id );
if ( ! $property )
{
return $request_data;
}
add_filter( 'propertyhive_search_form_action', 'set_search_form_action' );
function set_search_form_action($action)
{
if ( isset($_GET['department']) && $_GET['department'] == 'residential-lettings' )
{
return '/lettings/';
}
return '/sales/';
}
$enquiry_form_output_already = false;
add_filter( 'propertyhive_viewing_request_show_fields', 'hide_show_form_fields' );
function hide_show_form_fields($show)
{
global $enquiry_form_output_already;
if ( $enquiry_form_output_already === false )
{
// first one. Show fields
$enquiry_form_output_already = true;
// OLD SNIPPET:
add_filter( "houzez_property_feed_properties_due_import_expertagent", 'correct_department', 10, 2 );
function correct_department( $properties, $import_id )
{
foreach ( $properties as $i => $property )
{
if (
isset($property->numeric_price) &&
!empty((int)$property->numeric_price) &&
@propertyhive
propertyhive / gist:145bda0e7502ecf9b0288c7c248864d2
Last active March 27, 2026 09:21
Hide make enquiry for unavailable properties
add_action('wp', 'hide_enquiry_for_unavailable');
function hide_enquiry_for_unavailable()
{
if (!is_singular('property'))
{
return;
}
global $post;
$property = new PH_Property($post->ID);
add_action( "houzez_property_feed_property_imported_kyero", 'extract_features', 10, 4 );
function extract_features($post_id, $property, $import_id, $instance_id)
{
$garages = '';
if ( isset($property->features->feature) )
{
foreach ( $property->features->feature as $feature )
{
$text = trim((string)$feature);
@propertyhive
propertyhive / gist:549655da9c268ec74e79f5298f041ec2
Created March 4, 2026 12:46
Exclude user from daily schedule emails
add_filter( 'propertyhive_email_schedule_user_query', 'exclude_us' );
function exclude_us($args)
{
$args['exclude'] = array(1); // change 1 accordingly to your WordPress user ID
return $args;
}
add_filter( 'propertyhive_single_property_actions', 'remove_floorplans_and_virtual_tours_action' );
function remove_floorplans_and_virtual_tours_action( $actions )
{
foreach ( $actions as $i => $action )
{
if (
isset( $action['class'] ) &&
(
$action['class'] === 'action-floorplans' ||
$action['class'] === 'action-virtual-tour'