Skip to content

Instantly share code, notes, and snippets.

@propertyhive
propertyhive / gist:58f8c8231ebb43129c692426f3a0cd44
Created July 29, 2025 11:00
Elementor order by availability
add_filter('propertyhive_order_by_availability', function() {
return true;
});
add_action( 'pre_get_posts', 'custom_order_properties_by_availability', 10, 2 );
function custom_order_properties_by_availability($query)
{
if ( is_admin() )
{
return;
function houzez_get_infowindow_address( $post_id )
{
$icon = '<i class="houzez-icon icon-pin" aria-hidden="true"></i>';
$result = array();
$ph_property = new PH_Property($post_id);
if ( $ph_property->address_street != '' )
{
$result[] = $ph_property->address_street;
add_filter( "propertyhive_rtdf_property_due_import", 'rtdf_remove_html_entities' );
function rtdf_remove_html_entities($property)
{
// Summary
if ( isset($property['details']['summary']) )
{
// 1) Decode any HTML entities (so "&lt;p&gt;" becomes "<p>")
$decoded = html_entity_decode(
$property['details']['summary'],
ENT_QUOTES | ENT_HTML5,
add_action( "houzez_property_feed_property_imported_resales_online", 'from_price_qualifier', 10, 4 );
function from_price_qualifier($post_id, $property, $import_id, $instance_id)
{
if ( (string)$property->price == (string)$property->price_to )
{
update_post_meta($post_id, 'fave_property_price_prefix', 'From');
}
}
add_action( "propertyhive_property_imported_reapit_foundations_json", 'situation_as_features', 10, 2 );
function situation_as_features($post_id, $property)
{
if ( isset($property['situation']) && !empty($property['situation']) )
{
// Do existing feature functionality
$features = array();
if ( isset($property['specialFeatures']) && !empty($property['specialFeatures']) )
{
foreach ( $property['specialFeatures'] as $feature )
add_filter( 'propertyhive_register_post_type_property', 'change_property_slug' );
function change_property_slug( $args )
{
$args['rewrite'] = array( 'slug' => 'your-property-archive', 'with_front' => false );
return $args;
}
add_action( "propertyhive_property_imported_reapit_foundations_json", 'trim_postcode', 10, 2 );
function trim_postcode( $post_id, $property )
{
$explode_postcode = explode(" ", $property['address']['postcode']);
$address_fields_array = array_filter(array(
$property['address']['line1'],
$property['address']['line2'],
$property['address']['line3'],
$property['address']['line4'],
add_filter( 'elementor/frontend/widget/before_render', function( $widget )
{
// Only target specific widget types if needed
if ( $widget->get_name() !== 'property-availability' ) {
return;
}
// Get current post ID
$post_id = get_the_ID();
add_action( "houzez_property_feed_property_imported_xml", 'import_custom_features', 10, 4 );
function import_custom_features( $post_id, $property, $import_id, $instance_id )
{
wp_suspend_cache_invalidation( true );
wp_defer_term_counting( true );
wp_defer_comment_counting( true );
wp_delete_object_term_relationships( $post_id, "property_feature" );
// Heating
@propertyhive
propertyhive / gist:8b16a992bcb5381286d5ce55bd74de48
Last active June 20, 2025 09:59
Overwrite taxonomies links in AIOSEO breadcrumbs
add_filter( 'aioseo_breadcrumbs_trail', 'steves_breadcrumb_change' );
function steves_breadcrumb_change($breadcrumbs)
{
$new_breadcrumbs = array();
foreach ( $breadcrumbs as $breadcrumb )
{
if ( isset($breadcrumb['type']) && $breadcrumb['type'] == 'taxonomy' )
{
if ( $breadcrumb['label'] == 'To Let' || $breadcrumb['label'] == 'Let Agreed' || $breadcrumb['label'] == 'Let' )