Skip to content

Instantly share code, notes, and snippets.

add_action( "propertyhive_property_imported_street_json", 'set_low_profile', 10, 2 );
function set_low_profile($post_id, $property)
{
$low_profile = '';
if ( isset($property['salesListing']['is_low_profile']) && $property['salesListing']['is_low_profile'] === true )
{
$low_profile = 'yes';
}
update_post_meta( $post_id, '_low_profile', $low_profile );
}
add_shortcode( 'office_logo', function( $atts = [], $content = '' ) {
// Allow optional overrides
$atts = shortcode_atts(
[
'post_id' => 0, // property post ID (optional override)
'size' => 'full', // image size: thumbnail, medium, large, full
],
$atts,
'office_logo'
add_filter( 'propertyhive_property_query_meta_query', 'custom_commercial_price_query', 10, 2 );
function custom_commercial_price_query( $meta_query, $query )
{
if ( ! is_array( $meta_query ) ) {
$meta_query = array();
}
if (
isset( $_REQUEST['department'] ) && ( $_REQUEST['department'] == 'commercial' || ph_get_custom_department_based_on($_REQUEST['department']) == 'commercial' ) &&
isset( $_REQUEST['commercial_minimum_price'] ) && $_REQUEST['commercial_minimum_price'] != ''
// assuming the id of the form is 'student'. If different change the filter name
add_filter( 'propertyhive_search_form_fields_after_student', 'edit_property_search_form_fields' );
function edit_property_search_form_fields($fields)
{
$fields['_let_type']['value'] = X; // Where X is the Let Type set for Student properties
return $fields; // return the fields
}
add_action( 'propertyhive_before_search_results_loop_item_title', 'add_featured_flag', 15 );
function add_featured_flag()
{
global $property;
if ( $property->featured == 'yes' )
{
echo '<div class="flag flag-featured" style="position:absolute; text-transform:uppercase; font-size:13px; box-sizing:border-box; padding:7px 20px; top:0; left:97px; color:#FFF; background:#04301c !important;">Featured</div>';
}
}
@propertyhive
propertyhive / gist:1586fe59510210437a7424c31e3599cb
Last active October 30, 2025 23:16
Change Kato XML descriptions and order
add_filter( 'propertyhive_kato_xml_descriptions', 'change_kato_description_order', 10, 2 );
function change_kato_description_order( $descriptions, $import_id )
{
return array(
'specification_description',
'location',
'marketing_text_1',
'marketing_text_2',
'marketing_text_3',
'marketing_text_4',
@propertyhive
propertyhive / gist:15c754e7395fd5f8e6c6e7bcd3dca844
Created October 9, 2025 11:28
Hide Kato Units Table Columns
add_filter( 'propertyhive_import_kato_units_description_table_header_columns', 'remove_header_cols');
function remove_header_cols($header_columns)
{
if ( isset($header_columns['rent']) ) { unset($header_columns['rent']); }
if ( isset($header_columns['availability']) ) { unset($header_columns['availability']); }
return $header_columns;
}
add_filter( 'propertyhive_import_kato_units_description_table_data_columns', 'remove_data_cols', 10, 3);
add_filter( 'houzez_property_feed_update_postarr', 'retain_existing_data', 10, 4 );
function retain_existing_data( $my_post, $property, $import_id, $post_id ) {
// Get the existing post object
$existing_post = get_post( $post_id );
if ( $existing_post ) {
// Preserve existing values
$my_post['post_title'] = $existing_post->post_title;
$my_post['post_excerpt'] = $existing_post->post_excerpt;
$my_post['post_content'] = $existing_post->post_content;
add_filter( "houzez_property_feed_properties_due_import_kyero", 'new_build_only', 10, 2 );
add_filter( "houzez_property_feed_properties_due_import_xml", 'new_build_only', 10, 2 );
function new_build_only( $properties, $import_id )
{
$new_properties = array();
foreach ( $properties as $property )
{
if (isset($property->new_build) && (string)$property->new_build == '1')
{
@propertyhive
propertyhive / gist:f0a047c417fe221dc148a9cc4b014998
Created September 27, 2025 10:31
Disable property enquiry emails from sending
add_filter( 'wp_mail', 'stop_property_enquiry_email' );
function stop_property_enquiry_email( $args ) {
if ( isset( $args['subject'] ) && strpos( $args['subject'], 'Property Enquiry' ) !== false ) {
// Return false to completely cancel the email.
return false;
}
return $args;
}