Skip to content

Instantly share code, notes, and snippets.

add_filter( 'propertyhive_property_enquiry_to', 'custom_enquiry_to_address', 10, 2 );
function custom_enquiry_to_address( $to, $property_ids )
{
$property_id = is_array($property_ids) ? (int)$property_ids[0] : (int)$property_ids;
if ( empty($property_id) ) { return $to; }
$property = new PH_Property($property_id);
if ( $property->imported_id == 'REAPIT-ID-HERE' )
add_filter( 'houzez_property_feed_insert_postarr', 'strip_html_from_ea_description', 10, 3 );
add_filter( 'houzez_property_feed_update_postarr', 'strip_html_from_ea_description', 10, 3 );
function strip_html_from_ea_description($data, $property, $import_id)
{
$data['post_content'] = strip_tags($data['post_content']); // REMOVE THE HTML HERE
return $data;
}
$tax_query = $query->get('tax_query');
if ( !is_array($tax_query) ) { $tax_query = array(); }
$tax_query[] = [
'taxonomy' => 'availability',
'field' => 'ID',
'terms' => ['4', '5', '104'],
'operator' => 'NOT IN',
];
$query->set('tax_query', $tax_query);
add_action('propertyhive_after_search_form_controls', 'add_reset_button', 10, 2 );
function add_reset_button( $id, $form_controls )
{
echo '<input type="reset" value="Reset" />';
}
add_filter( 'houzez_property_feed_expertagent_departments_to_import', 'customise_ea_depts' );
function customise_ea_depts($departments)
{
$departments[] = 'catering';
$departments[] = 'development';
$departments[] = 'flat';
$departments[] = 'hotels';
$departments[] = 'house';
$departments[] = 'industrial';
$departments[] = 'investment';
add_filter( 'houzez_property_feed_update_postarr', 'keep_title', 10, 4 );
function keep_title($data, $property, $import_id, $post_id)
{
if ( empty($post_id))
{
return $data;
}
$post = get_post( $post_id );
add_filter( 'propertyhive_countries', 'add_eg' );
function add_eg($countries)
{
$countries['EG'] = array(
'name' => 'Egypt',
'currency_code' => 'EGP',
'currency_symbol' => 'E&pound;',
'currency_prefix' => true
);
@propertyhive
propertyhive / gist:7efab68d409c0269833f400f1c871fa8
Last active January 19, 2026 11:58
Don't update title on subsequent updates
add_filter( 'houzez_property_feed_xml_mapped_field_value', 'only_title_on_first_import', 10, 5 );
function only_title_on_first_import($content, $property, $field, $import_id, $post_id = '')
{
if ( $field != 'post_title' )
{
return $content;
}
if ( empty($post_id))
{
@propertyhive
propertyhive / gist:fb102dc018f2e65cf8322f3af6d2e233
Created December 4, 2025 10:50
Use full address in enquiry subject
add_filter( 'propertyhive_property_enquiry_subject', 'customise_enquiry_subject', 10, 2 );
function customise_enquiry_subject($subject, $property_ids)
{
if ( count($property_ids) == 1 )
{
$property = new PH_Property((int)$property_ids[0]);
$subject = __( 'New Property Enquiry', 'propertyhive' ) . ': ' . $property->get_formatted_full_address();
}
else
{
add_action( "propertyhive_wpresidence_property_synced", 'set_property_user', 10, 3 );
function set_property_user($property_id, $post_id, $synced)
{
update_post_meta($post_id, 'property_user', '123'); // Change 123 to the Id of the user in WP you wish to assign to
}