This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( "propertyhive_rtdf_property_due_import", 'masons_remove_html_entities' ); | |
function masons_remove_html_entities($property) | |
{ | |
// Summary | |
if ( isset($property['details']['summary']) ) | |
{ | |
// 1) Decode any HTML entities (so "<p>" becomes "<p>") | |
$decoded = html_entity_decode( | |
$property['details']['summary'], | |
ENT_QUOTES | ENT_HTML5, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
NewerOlder