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' ) |
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_insert_postarr', 'strip_html_from_ea_description', 10, 3 ); | |
| add_filter( 'houzez_property_feed_update_postarr', 'strip_html_from_ea_description', 10, 3 ); | |
| function strip_html_from_ea_description($data, $property, $import_id) | |
| { | |
| $data['post_content'] = strip_tags($data['post_content']); // REMOVE THE HTML HERE | |
| 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
| $tax_query = $query->get('tax_query'); | |
| if ( !is_array($tax_query) ) { $tax_query = array(); } | |
| $tax_query[] = [ | |
| 'taxonomy' => 'availability', | |
| 'field' => 'ID', | |
| 'terms' => ['4', '5', '104'], | |
| 'operator' => 'NOT IN', | |
| ]; | |
| $query->set('tax_query', $tax_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('propertyhive_after_search_form_controls', 'add_reset_button', 10, 2 ); | |
| function add_reset_button( $id, $form_controls ) | |
| { | |
| echo '<input type="reset" value="Reset" />'; | |
| } |
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_departments_to_import', 'customise_ea_depts' ); | |
| function customise_ea_depts($departments) | |
| { | |
| $departments[] = 'catering'; | |
| $departments[] = 'development'; | |
| $departments[] = 'flat'; | |
| $departments[] = 'hotels'; | |
| $departments[] = 'house'; | |
| $departments[] = 'industrial'; | |
| $departments[] = 'investment'; |
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_update_postarr', 'keep_title', 10, 4 ); | |
| function keep_title($data, $property, $import_id, $post_id) | |
| { | |
| if ( empty($post_id)) | |
| { | |
| return $data; | |
| } | |
| $post = get_post( $post_id ); | |
NewerOlder