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 | |
| } |
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
| BEFORE (lines 557-590): | |
| if ( $rule['equal'] == '*' ) | |
| { | |
| $found = true; | |
| } | |
| elseif ( | |
| ( !isset($rule['operator']) || ( isset($rule['operator']) && $rule['operator'] == '=' ) ) && trim($value_to_check) == $rule['equal'] | |
| ) | |
| { |
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_microsoft_graph_event_negotiator_ids', 'only_certain_members', 10, 2 ); | |
| function only_certain_members( $attending_wordpress_user_ids, $post_id ) | |
| { | |
| if ( empty($attending_wordpress_user_ids) ) | |
| { | |
| $attending_wordpress_user_ids = array(1, 2, 3, 4); // CHANGE THIS!! | |
| } | |
| return $attending_wordpress_user_ids; | |
| } |
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_get_search_results_ordering_args', 'order_students_by_pppm' ); | |
| function order_students_by_pppm($args) | |
| { | |
| if ( | |
| ( !isset($_REQUEST['department']) && get_option( 'propertyhive_primary_department', '' ) == 'student' ) | |
| || | |
| ( isset($_REQUEST['department']) && $_REQUEST['department'] == 'student' ) | |
| ) | |
| { | |
| // if searching student properties |
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_price_output', 'student_per_person', 10, 5 ); | |
| function student_per_person($return, $property, $currency, $prefix, $suffix) | |
| { | |
| if ( $property->department != 'student' ) | |
| { | |
| return $return; | |
| } | |
| $bedrooms = (int)$property->bedrooms; | |
| if ( empty($bedrooms) ) |
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
| do_action( "propertyhive_property_imported_kato_xml", 'cater_for_sale_and_let', 10, 3 ); | |
| function cater_for_sale_and_let( $post_id, $property, $import_id ) | |
| { | |
| $types = []; | |
| foreach ($property->availabilities->type as $type) { | |
| $types[] = (string)$type['id']; | |
| } | |
| if (in_array('tolet', $types) && in_array('forsale', $types)) | |
| { |
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_get_detail', 'change_bedrooms', 10, 3 ); | |
| function change_bedrooms($value, $key, $property) | |
| { | |
| if ( $key != 'bedrooms' ) { return $value; } | |
| if ( $property->_bedrooms == '0' ) | |
| { | |
| return 'Studio'; | |
| } | |
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_arthur_json_properties_due_import", 'property_tags_on_unit', 10, 2 ); | |
| function property_tags_on_unit( $properties, $import_id ) | |
| { | |
| foreach ( $properties as $i => $property ) | |
| { | |
| $tags = isset($property['tags']) && !empty($property['tags']) ? $property['tags'] : array(); | |
| if ( !empty($tags) ) | |
| { | |
| if ( |
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/onmarketpropertyquery', 'handle_sold_tickbox' ); | |
| function handle_sold_tickbox($query) | |
| { | |
| $tax_query = $q->get('tax_query'); | |
| if ( !isset($_GET['include_sold_stc']) ) | |
| { | |
| // Not ticked. Only include available properties | |
| if (!is_array($tax_query)) { $tax_query = array(); } |
NewerOlder