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_agentsinsight_xml_properties_due_import', 'filter_kato_properties_by_tag', 10, 1 ); | |
function filter_kato_properties_by_tag( $properties ) | |
{ | |
$allowed_tags = array( 'British Museum' ); // Define your allowed tags here | |
$filtered_properties = array(); | |
foreach ( $properties as $property ) | |
{ | |
if ( isset($property->tags) ) | |
{ |
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_agentsinsight_xml_properties_due_import', 'filter_kato_properties_by_tag', 10, 1 ); | |
function filter_kato_properties_by_tag( $properties ) { | |
$allowed_tags = array( 'British Museum' ); // Define your allowed tags here | |
$filtered_properties = array(); | |
foreach ( $properties as $property ) { | |
if ($property['tags'] == null || !is_array($property['tags'])) { | |
continue; | |
} |
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_kyero_xml", 'set_kyero_statuses', 10, 3 ); | |
function set_kyero_statuses( $post_id, $property, $import_id ) | |
{ | |
wp_suspend_cache_invalidation( true ); | |
wp_defer_term_counting( true ); | |
wp_defer_comment_counting( true ); | |
$department = 'residential-sales'; | |
if ( isset($property->price_freq) && ( (string)$property->price_freq == 'week' || (string)$property->price_freq == 'month' ) ) | |
{ |
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_shortcode('property_address', 'property_owners'); | |
function property_owners() | |
{ | |
global $property; | |
if ( !isset($property->id) ) { | |
return; | |
} | |
ob_start(); |
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_use_propertyhive_templates', 'dont_use_hive_templates' ); | |
function dont_use_hive_templates($use_ph) | |
{ | |
return false; | |
} |
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_property_enquiry_to', 'customise_enquiry_to', 10, 2 ); | |
function customise_enquiry_to( $to, $property_ids ) | |
{ | |
foreach ($property_ids as $property_id) | |
{ | |
$owner_ids = get_post_meta( $property_id, '_owner_contact_id', TRUE ); | |
if ( $owner_ids == '') | |
return $to; | |
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
jQuery(document).ready(function() | |
{ | |
jQuery(document).on('ph:infinite_scroll_loading_properties', function(event) | |
{ | |
// do something here | |
}); | |
}); |
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( 'gettext', 'propertyhive_book_viewing_label', 99, 3 ); | |
function propertyhive_book_viewing_label( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) | |
{ | |
case 'Book Viewing' : | |
{ | |
$translated_text = 'My Viewing Button label Here'; | |
break; | |
} |
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
/* | |
* Random display of properties option | |
*/ | |
add_filter('propertyhive_default_search_results_orderby', 'change_default_order'); | |
function change_default_order($orderby) | |
{ | |
return 'rand'; | |
} |
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_inmobalia_xml", 'import_sizes', 10, 3 ); | |
function import_sizes( $post_id, $property, $import_id ) | |
{ | |
if ( isset($property->mts_build) ) | |
{ | |
update_post_meta( $post_id, '_build_area', (string)$property->mts_build ); | |
} | |
if ( isset($property->mts_plot) ) | |
{ |
NewerOlder