Skip to content

Instantly share code, notes, and snippets.

add_filter( 'propertyhive_demo_data_num_items', 'increase_demo_data_items' );
function increase_demo_data_items($num)
{
return 20;
}
add_filter( 'houzez_property_feed_auto_create_new_features', 'dont_auto_create_features' );
function dont_auto_create_features($auto_create)
{
return false;
}
add_filter( 'propertyhive_reapit_foundations_json_properties_requests', 'remove_sales_from_foundations_requests' );
function remove_sales_from_foundations_requests( $requests )
{
unset($requests['sales']);
return $requests;
}
add_action( 'propertyhive_property_import_cron', 'run_blm_export', 10, 3 );
function run_blm_export( $options, $instance_id, $import_id )
{
do_action( 'phblmexportcronhook' );
}
add_filter( "propertyhive_apex27_xml_properties_due_import", 'exclude_office_from_apex27', 10, 2 );
function exclude_office_from_apex27($properties, $import_id)
{
$new_properties = array();
foreach ($properties as $property)
{
if ( isset($property->Branch) && (string)$property->Branch == 'C21 Estrie RE' )
{
// do nothing, we don't want this property
add_action( "propertyhive_property_imported_street_json", 'set_buyer_report', 10, 2 );
function set_buyer_report($post_id, $property)
{
if ( isset($property['attributes']['property_urls']) && !empty($property['attributes']['property_urls']) )
{
foreach ( $property['attributes']['property_urls'] as $url )
{
if ( $url['media_type'] == 'brochure' )
{
update_post_meta( $post_id, '_buyer_report', $url['media_url'] );
add_action( "houzez_property_feed_pre_import_properties_xml", 'check_for_big_drop', 10, 2 );
function check_for_big_drop( $properties, $import_id )
{
// get number of existing published properties imported for this import
$args = array(
'post_type' => 'property',
'posts_per_page' => -1,
'post_status' => 'publish',
'fields' => 'ids',
'meta_query' => array(
"propertyCode":"BOMAAP9945",
"propertyReference":"P7205A",
"propertyDescriptions":[
{
"descriptionLanguage": "english",
"descriptionText":"This exclusive plot in Marbella offers a unique opportunity to build your dream residence on the Costa del Sol. With a generous extension of 1493 square metres, the plot is strategically positioned with south orientation, guaranteeing optimal solar exposure and dazzling panoramic views. Located in a privileged area, the plot enjoys proximity to amenities, beaches and places of interest, providing convenience and luxurious lifestyle.\r\n\r\nWith a building coefficient of 0.60 for semi-detached houses and 0.40 for detached villas, future owners have the flexibility to design a spacious and elegant residence, making the most of the plot''s potential. This standard allows for the creation of a home that blends harmoniously with its surroundings, combining modernity and contemporary comforts. Whether for a permanent residence or a luxury getaway, this plot represent
add_action( "houzez_property_feed_property_imported_street", 'convert_sq_m_to_sq_ft', 10, 4 );
function convert_sq_m_to_sq_ft( $post_id, $property, $import_id, $instance_id )
{
if ( isset($property['attributes']['floor_area']) && !empty($property['attributes']['floor_area']) )
{
$floor_area = $property['attributes']['floor_area'];
// convert
$floor_area = $floor_area * 10.764;
@propertyhive
propertyhive / gist:f10fd11f714f3cdee7f46f37ed1b4e1a
Created July 30, 2025 06:35
Import specific agent/account from Rex
add_filter( 'propertyhive_rex_property_request_body', 'filter_account_in_rex_request' );
function filter_account_in_rex_request($data)
{
$data['criteria'][] = array(
"name" => "account_id",
"type" => "=",
"value" => "4392"
);
return $data;