Skip to content

Instantly share code, notes, and snippets.

add_filter('propertyhive_property_import_remove_properties_in_php', 'remove_in_php');
function remove_in_php($in_php)
{
return true;
}
@propertyhive
propertyhive / gist:213604e833e673749d080e4717b4f1ec
Created September 8, 2025 11:53
Add office name to enquiry emails
add_filter( 'propertyhive_property_enquiry_property_output', 'customise_property_output_in_enquiry', 10, 2 );
function customise_property_output_in_enquiry( $output, $property_id )
{
$property = new PH_Property((int)$property_id);
$office_name = $property->office_name;
return 'Office: ' . $office_name . '\n' . $output;
}
/* Get parking */
add_action( "propertyhive_property_imported_jupix_xml", 'assign_parking_taxonomy', 10, 2 );
function assign_parking_taxonomy($post_id, $property)
{
wp_suspend_cache_invalidation( true );
wp_defer_term_counting( true );
wp_defer_comment_counting( true );
$parking_types = array();
add_action( 'propertyhive_property_imported_kyero_xml', 'use_nl_description_and_custom_title', 10, 2 );
function use_nl_description_and_custom_title( $post_id, $property ) {
if ( $property->type->en )
{
$property_type = (string)$property->type->en;
}
else
{
$property_type = (string)$property->type;
@propertyhive
propertyhive / gist:d82bdf69981e4d44388cd80256c6f8c2
Created September 8, 2025 07:45
Order property type taxonomy dropdown by most popular
add_filter( 'propertyhive_form_taxonomy_terms_args', 'custom_property_type_order', 10, 2 );
function custom_property_type_order($args, $field)
{
if ( $field['type'] == 'property_type' )
{
$args['orderby'] = 'count';
$args['order'] = 'DESC';
}
return $args;
}
add_filter( 'houzez_property_feed_clean_price_on_import', 'dont_clean_price');
function dont_clean_price( $clean )
{
return false;
}
document.addEventListener('click', function (e) {
const btn = e.target.closest('.e-n-tab-title');
if (!btn) return;
afterActivation(btn, () => {
if (btn.getAttribute('aria-selected') === 'true') {
const idx = Number(btn.getAttribute('data-tab-index'));
if ( idx == 2 )
{
initialize_property_street_view();
add_action( "propertyhive_property_imported_agentos_json", "set_new_home_flag", 10, 2 );
function set_new_home_flag( $post_id, $property )
{
if ( isset($property['IsNewHome']) && $property['IsNewHome'] === true )
{
wp_suspend_cache_invalidation( true );
wp_defer_term_counting( true );
wp_defer_comment_counting( true );
wp_set_post_terms( $post_id, 123, 'marketing_flag' ); // Set 123 to term ID of 'New Home' flag set in 'Property hive > Settings > Cutom Fields > Marketing Flags
add_filter( "houzez_property_feed_properties_due_import_xml", 'exclude_lease', 10, 2 );
function exclude_lease( $properties, $import_id )
{
$new_properties = array();
foreach ( $properties as $property )
{
if ( isset($property->Categories) && (string)$property->Categories === 'Lease' )
{
// ignore
<?php
// Place where you want this new section output:
if ( isset($_GET['address_keyword']) && !empty($_GET['address_keyword']) )
{
$address_keyword = sanitize_text_field($_GET['address_keyword']);
$radius = 10;
if ( isset($_GET['radius']) && !empty($_GET['radius']) )
{
$radius = (int)$_GET['radius'] + 10; // add 10 miles to the radius already being searched