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", 'rtdf_remove_html_entities' ); | |
| function rtdf_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; | |
| } |
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", 'trim_postcode', 10, 2 ); | |
| function trim_postcode( $post_id, $property ) | |
| { | |
| $explode_postcode = explode(" ", $property['address']['postcode']); | |
| $address_fields_array = array_filter(array( | |
| $property['address']['line1'], | |
| $property['address']['line2'], | |
| $property['address']['line3'], | |
| $property['address']['line4'], |
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( 'elementor/frontend/widget/before_render', function( $widget ) | |
| { | |
| // Only target specific widget types if needed | |
| if ( $widget->get_name() !== 'property-availability' ) { | |
| return; | |
| } | |
| // Get current post ID | |
| $post_id = get_the_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_action( "houzez_property_feed_property_imported_xml", 'import_custom_features', 10, 4 ); | |
| function import_custom_features( $post_id, $property, $import_id, $instance_id ) | |
| { | |
| wp_suspend_cache_invalidation( true ); | |
| wp_defer_term_counting( true ); | |
| wp_defer_comment_counting( true ); | |
| wp_delete_object_term_relationships( $post_id, "property_feature" ); | |
| // Heating |
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( 'aioseo_breadcrumbs_trail', 'steves_breadcrumb_change' ); | |
| function steves_breadcrumb_change($breadcrumbs) | |
| { | |
| $new_breadcrumbs = array(); | |
| foreach ( $breadcrumbs as $breadcrumb ) | |
| { | |
| if ( isset($breadcrumb['type']) && $breadcrumb['type'] == 'taxonomy' ) | |
| { | |
| if ( $breadcrumb['label'] == 'To Let' || $breadcrumb['label'] == 'Let Agreed' || $breadcrumb['label'] == 'Let' ) |