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_single_property_virtual_tours_actions', | |
| 'force_virtual_tour_label' | |
| ); | |
| function force_virtual_tour_label( $actions ) { | |
| if ( empty( $actions ) || ! is_array( $actions ) ) { | |
| return $actions; | |
| } |
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( 'houzez_property_feed_include_deleted_in_filter', 'exclude_deleted_imports' ); | |
| function exclude_deleted_imports($include) | |
| { | |
| 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( 'houzez_property_feed_export_thinkspain_property_data', 'add_new_build_to_ts_xml', 10, 3 ); | |
| function add_new_build_to_ts_xml( $property_xml, $post_id, $export_id ) | |
| { | |
| if ( has_term( 'New Build', 'property_label', $post_id ) && !isset( $property_xml->new_build ) ) | |
| { | |
| $property_xml->addChild( 'new_build', '1' ); | |
| } | |
| return $property_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_filter( "houzez_property_feed_properties_due_import_apimo", 'filter_by_user', 10, 2 ); | |
| function filter_by_user($properties, $import_id) | |
| { | |
| $new_properties = array(); | |
| foreach ( $properties as $property ) | |
| { | |
| if ( | |
| $property['user']['id'] == '122544' || | |
| $property['user']['id'] == '26907394' |
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( 'houzez_property_feed_expertagent_feature_count', 'custom_ea_num_features' ); | |
| function custom_ea_num_features($features) | |
| { | |
| return 5; | |
| } |
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
| // Adds a Query ID 'soldpropertyquery' that can be used in Loop Grid widget | |
| add_action( 'elementor/query/soldpropertyquery', 'elementor_query_sold_only' ); | |
| function elementor_query_sold_only( $query ) { | |
| // Ensure we only query the 'properties' custom post type | |
| $query->set( 'post_type', 'property' ); | |
| // Add tax query for Availability = Sold | |
| $tax_query = array( | |
| 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( 'houzez_property_feed_propctrl_off_market_statuses', 'exclude_pending' ); | |
| function exclude_pending($exclude_statuses) | |
| { | |
| $exclude_statuses[] = 'pending'; | |
| return $exclude_statuses; | |
| } |
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_kyero", 'import_custom_plans_node', 10, 4 ); | |
| function import_custom_plans_node($post_id, $property, $import_id, $instance_id) | |
| { | |
| $floorplans = array(); | |
| if (isset($property->plans) && !empty($property->plans)) | |
| { | |
| foreach ($property->plans as $plans) | |
| { | |
| if (!empty($plans->plan)) |
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('update_post_metadata', function ($check, $object_id, $meta_key, $meta_value, $prev_value) { | |
| if ($meta_key !== 'fave_property_id') { | |
| return $check; | |
| } | |
| // 1) Manual edits in wp-admin should always be allowed. | |
| // We treat "manual" as the classic post edit save (not AJAX/REST). | |
| $is_manual_admin_save = | |
| is_admin() |
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', 'custom_enquiry_to_address', 10, 2 ); | |
| function custom_enquiry_to_address( $to, $property_ids ) | |
| { | |
| $property_id = is_array($property_ids) ? (int)$property_ids[0] : (int)$property_ids; | |
| if ( empty($property_id) ) { return $to; } | |
| $property = new PH_Property($property_id); | |
| if ( $property->imported_id == 'REAPIT-ID-HERE' ) |
NewerOlder