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 ); | |
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_countries', 'add_eg' ); | |
| function add_eg($countries) | |
| { | |
| $countries['EG'] = array( | |
| 'name' => 'Egypt', | |
| 'currency_code' => 'EGP', | |
| 'currency_symbol' => 'E£', | |
| 'currency_prefix' => true | |
| ); | |
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_xml_mapped_field_value', 'only_title_on_first_import', 10, 5 ); | |
| function only_title_on_first_import($content, $property, $field, $import_id, $post_id = '') | |
| { | |
| if ( $field != 'post_title' ) | |
| { | |
| return $content; | |
| } | |
| if ( empty($post_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_property_enquiry_subject', 'customise_enquiry_subject', 10, 2 ); | |
| function customise_enquiry_subject($subject, $property_ids) | |
| { | |
| if ( count($property_ids) == 1 ) | |
| { | |
| $property = new PH_Property((int)$property_ids[0]); | |
| $subject = __( 'New Property Enquiry', 'propertyhive' ) . ': ' . $property->get_formatted_full_address(); | |
| } | |
| else | |
| { |
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_wpresidence_property_synced", 'set_property_user', 10, 3 ); | |
| function set_property_user($property_id, $post_id, $synced) | |
| { | |
| update_post_meta($post_id, 'property_user', '123'); // Change 123 to the Id of the user in WP you wish to assign to | |
| } |
NewerOlder