Skip to content

Instantly share code, notes, and snippets.

@propertyhive
propertyhive / gist:ea99fe91535a92044ec56383a351be41
Created February 19, 2026 16:58
OSM icon marker size and anchor
add_filter('propertyhive_property_map_osm_icon_width', function ($w) {
return 40;
});
add_filter('propertyhive_property_map_osm_icon_height', function ($h) {
return 40;
});
add_filter('propertyhive_property_map_osm_icon_anchor_width', function ($aw) {
return 20; // half of width
add_filter( "houzez_property_feed_properties_due_import_resales_online", 'malaga_only', 10, 2 );
function malaga_only($properties, $import_id)
{
$new_properties = array();
foreach ( $properties as $property )
{
if ( (string)$property->province == 'Málaga' )
{
$new_properties[] = $property;
}
add_filter( 'houzez_property_feed_insert_postarr', 'draft_on_insert', 10, 3 );
function draft_on_insert( $data, $property, $import_id )
{
$data['post_status'] = 'draft';
return $data;
}
add_filter( 'houzez_property_feed_update_postarr', 'keep_title_content_and_status', 10, 4 );
function keep_title_content_and_status($data, $property, $import_id, $post_id)
// Setup two separate URLs
add_action( 'init', 'ph_add_rewrite_rules' );
function ph_add_rewrite_rules()
{
global $wp_rewrite;
// Setup Sales URL '/sales/'
add_rewrite_rule( "sales/?$", "index.php?post_type=property&department=residential-sales", 'top' );
add_rewrite_rule( "sales/{$wp_rewrite->pagination_base}/([0-9]{1,})/?$", "index.php?post_type=property&department=residential-sales" . '&paged=$matches[1]', 'top' );
add_action( "propertyhive_sturents_v2_property_imported", 'hardcode_title_and_to_eur', 10, 2 );
function hardcode_title_and_to_eur($post_id, $property)
{
// Set title to room type
$my_post = array(
'ID' => $post_id,
'post_title' => wp_strip_all_tags( $property['room_type'] ),
'post_excerpt' => $property['description'],
'post_content' => '',
'post_status' => 'publish',
add_action( 'propertyhive_property_map_marker_options', 'set_marker_size' );
function set_marker_size()
{
?>
marker_options.icon.scaledSize = new google.maps.Size(12, 12); // change 12, 12 accordingly
<?php
}
add_filter( 'propertyhive_locate_template', 'intercept_ph_template', 10, 3 );
function intercept_ph_template( $template, $template_name, $template_path )
{
if ( 'loop-start.php' === basename( $template ) ) {
$template = trailingslashit( plugin_dir_path( __FILE__ ) ) . 'ph/templates/search/loop-start.php';
}
if ( 'loop-end.php' === basename( $template ) ) {
$template = trailingslashit( plugin_dir_path( __FILE__ ) ) . 'ph/templates/search/loop-end.php';
}
return $template;
@propertyhive
propertyhive / gist:f2304c211251e40a609da5b9ef5db308
Created February 5, 2026 12:02
Force virtual tour button label
add_filter(
'propertyhive_single_property_virtual_tours_actions',
'force_virtual_tour_label'
);
function force_virtual_tour_label( $actions ) {
if ( empty( $actions ) || ! is_array( $actions ) ) {
return $actions;
}
add_filter( 'houzez_property_feed_include_deleted_in_filter', 'exclude_deleted_imports' );
function exclude_deleted_imports($include)
{
return false;
}
add_filter( 'houzez_property_feed_export_thinkspain_property_data', 'add_new_build_to_ts_xml', 10, 3 );
function add_new_build_to_ts_xml( $property_xml, $post_id, $export_id )
{
if ( has_term( 'New Build', 'property_label', $post_id ) && !isset( $property_xml->new_build ) )
{
$property_xml->addChild( 'new_build', '1' );
}
return $property_xml;
}