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_10ninety_xml', | |
| 'import_includes_searchable_area', | |
| 10, | |
| 2 | |
| ); | |
| function import_includes_searchable_area( $post_id, $property ) { | |
| $searchable_areas = 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
| add_filter( 'propertyhive_property_imported_agency_pilot_api', 'import_ap_reference_number', 10, 2 ); | |
| function import_ap_reference_number( $post_id, $property ) | |
| { | |
| $reference_number = ! empty( $property['FileRef'] ) | |
| ? $property['FileRef'] | |
| : $property['ID']; | |
| update_post_meta( $post_id, '_reference_number', $reference_number ); | |
| } |
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
| // Remove the Home Reports importer that downloads the file | |
| remove_action( | |
| 'propertyhive_property_imported_apex27_xml', | |
| array( PHHR(), 'import_apex27_xml_home_reports' ), | |
| 10 | |
| ); | |
| // Add our replacement importer | |
| add_action( | |
| 'propertyhive_property_imported_apex27_xml', |
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( | |
| 'elementor/query/plotspropertyquery', | |
| 'elementor_query_plots' | |
| ); | |
| function elementor_query_plots( $query ) { | |
| $current_property_id = get_queried_object_id(); | |
| if ( ! $current_property_id ) { |
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_reapit_foundations_json_properties_url_parameters', | |
| 'extra_fields_in_reapit' | |
| ); | |
| function extra_fields_in_reapit( $url_parameters ) | |
| { | |
| $url_parameters['extrasField'] = array( | |
| //'pLongDesc', //uncomment if standard longDescription field is not present | |
| 'pAccomComp', |
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('ph_kyero_feed_type_mapping_options', 'my_kyero_type_mapping', 10, 2); | |
| function my_kyero_type_mapping($mapping, $custom_field) { | |
| // Add a new property type | |
| $mapping['bungalow'] = 'Bungalow'; | |
| // Change an existing mapping | |
| $mapping['villa'] = 'Luxury Villa'; |
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
| //seems to be a conflict, when using the loop carousel at least between query ID code and the tax filters, so it needs to be hardcoded into the query ID | |
| add_action( | |
| 'elementor/query/allfeaturedpropertiesquery', | |
| 'elementor_query_all_featured_properties' | |
| ); | |
| function elementor_query_all_featured_properties( $query ) | |
| { | |
| PH()->query->property_query( $query ); |
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('wp_footer', function () { | |
| ?> | |
| <script> | |
| jQuery(function ($) { | |
| $(document).on('ph:toggleSearchDepartment', function () { | |
| $('#property_type') | |
| .attr('multiple', true) | |
| .attr('name', 'property_type[]'); | |
| }); |
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('wp_footer', function () { | |
| ?> | |
| <script> | |
| jQuery(function ($) { | |
| // Only run if a property search form exists on the page | |
| if (!$('.property-search-form').length) { | |
| 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
| //useful for setting the default date changed in PH (on market change date) to the last updated date in street for initial imports to have good sorting from the beginning. Another approach should probably be used to ALWAYS use the street date | |
| add_action( 'propertyhive_property_imported_street_json', 'set_on_market_change_date_from_updated_at', 10, 2 ); | |
| function set_on_market_change_date_from_updated_at( $post_id, $property ) | |
| { | |
| if ( ! empty( $property['attributes']['updated_at'] ) ) | |
| { | |
| // Convert ISO8601 format (2026-07-06T14:09:07+01:00) | |
| // to WordPress datetime format (2026-07-06 14:09:07) |
NewerOlder