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_unit_imported_arthur_json", 'use_unit_ref_as_post_title', 10, 2 ); | |
| function use_unit_ref_as_post_title($post_id, $unit) | |
| { | |
| $new_title = ''; | |
| if ( isset($unit['unit_ref']) && $unit['unit_ref'] != '' ) | |
| { | |
| $new_title = $unit['unit_ref']; | |
| } | |
| else{ | |
| 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
| add_action( 'elementor/query/allonmarketpropertyquerynoordering ', 'query_but_no_ordering', 99 ); | |
| function query_but_no_ordering( $query ) | |
| { | |
| PH()->query->property_query( $query ); | |
| // Set the custom post type | |
| $query->set( 'post_type', [ 'property' ] ); | |
| // ensure a department is set as not set by default from property_query | |
| $meta_query = $query->get('meta_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_filter('propertyhive_search_form_fields_default', 'edit_default_property_search_form_fields', 99); | |
| function edit_default_property_search_form_fields($fields) | |
| { | |
| $fields['available_from'] = array( | |
| 'type' => 'select', | |
| 'label' => __('Available From', 'propertyhive'), | |
| 'show_label' => true, | |
| 'before' => '<div class="control control-available_from">', | |
| 'options' => array( | |
| '' => 'No Preference', |
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_search_form_fields', 'change_search_form_labels', 1, 99); | |
| function change_search_form_labels($form_controls){ | |
| if(isset($form_controls['department']['options']['rooms'])){ | |
| $form_controls['department']['options']['rooms'] = "Rooms To Let"; | |
| } | |
| return $form_controls; | |
| } |
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_reapit_foundations_json_import_lettings_statuses', 'include_new_lettings_status_reapit' ) | |
| function include_new_lettings_status_reapit($statuses) | |
| { | |
| return array( 'toLet', 'underOffer', 'let' ); | |
| } |
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 rr_viewing_shortcode() { | |
| global $property; | |
| $ref = $property->reference_number; | |
| $address = $property->address_name_number; | |
| ob_start(); | |
| ?> | |
| <div data-paperform-id="regal-rentals-viewing-request-form" data-prefill="Ref=<?php echo $ref;?>&Address=<?php echo $address;?>"></div> |
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_shortcode_similar_properties_query','match_addresses_2_and_3', 2, 10); | |
| function match_addresses_2_and_3($args, $atts){ | |
| $original_match_query = $args['meta_query'][3]; | |
| if($original_match_query['key']!='_address_three'){return $args;} | |
| $new_match_query[] = $original_match_query; | |
| $new_match_query[] = array("key" => "_address_two", "value" => $original_match_query["value"]); | |
| $args['meta_query'][3] = array('relation' => 'OR', $new_match_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_shortcode("room_counts", "output_room_counts"); | |
| function output_room_counts(){ | |
| global $property; | |
| $bedrooms = $property->bedrooms; | |
| $bathrooms = $property->bathrooms; | |
| $reception_rooms = $property->reception_rooms; | |
| $rooms= []; | |
| 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
| add_action("propertyhive_property_actions_start", "remove_enquiry_button_for_sold"); | |
| function remove_enquiry_button_for_sold(){ | |
| global $property; | |
| if( in_array($property->availability, ['Sold STC']) ){ | |
| remove_action( 'propertyhive_property_actions_list_start', 'propertyhive_make_enquiry_button', 10 ); | |
| } | |
| } |
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_kyero_xml', 'use_nl_description', 10, 2 ); | |
| function use_nl_description( $post_id, $property ) { | |
| $desc = (string)$property->desc->nl; | |
| $post = array( | |
| 'ID' => $post_id, | |
| 'post_excerpt' => $desc, | |
| ); |
OlderNewer