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(); } |
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_street_json", 'set_low_profile', 10, 2 ); | |
| function set_low_profile($post_id, $property) | |
| { | |
| $low_profile = ''; | |
| if ( isset($property['salesListing']['is_low_profile']) && $property['salesListing']['is_low_profile'] === true ) | |
| { | |
| $low_profile = 'yes'; | |
| } | |
| update_post_meta( $post_id, '_low_profile', $low_profile ); | |
| } |
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( 'office_logo', function( $atts = [], $content = '' ) { | |
| // Allow optional overrides | |
| $atts = shortcode_atts( | |
| [ | |
| 'post_id' => 0, // property post ID (optional override) | |
| 'size' => 'full', // image size: thumbnail, medium, large, full | |
| ], | |
| $atts, | |
| 'office_logo' |
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_query_meta_query', 'custom_commercial_price_query', 10, 2 ); | |
| function custom_commercial_price_query( $meta_query, $query ) | |
| { | |
| if ( ! is_array( $meta_query ) ) { | |
| $meta_query = array(); | |
| } | |
| if ( | |
| isset( $_REQUEST['department'] ) && ( $_REQUEST['department'] == 'commercial' || ph_get_custom_department_based_on($_REQUEST['department']) == 'commercial' ) && | |
| isset( $_REQUEST['commercial_minimum_price'] ) && $_REQUEST['commercial_minimum_price'] != '' |
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
| // assuming the id of the form is 'student'. If different change the filter name | |
| add_filter( 'propertyhive_search_form_fields_after_student', 'edit_property_search_form_fields' ); | |
| function edit_property_search_form_fields($fields) | |
| { | |
| $fields['_let_type']['value'] = X; // Where X is the Let Type set for Student properties | |
| return $fields; // return the fields | |
| } |
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_before_search_results_loop_item_title', 'add_featured_flag', 15 ); | |
| function add_featured_flag() | |
| { | |
| global $property; | |
| if ( $property->featured == 'yes' ) | |
| { | |
| echo '<div class="flag flag-featured" style="position:absolute; text-transform:uppercase; font-size:13px; box-sizing:border-box; padding:7px 20px; top:0; left:97px; color:#FFF; background:#04301c !important;">Featured</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_kato_xml_descriptions', 'change_kato_description_order', 10, 2 ); | |
| function change_kato_description_order( $descriptions, $import_id ) | |
| { | |
| return array( | |
| 'specification_description', | |
| 'location', | |
| 'marketing_text_1', | |
| 'marketing_text_2', | |
| 'marketing_text_3', | |
| 'marketing_text_4', |
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_import_kato_units_description_table_header_columns', 'remove_header_cols'); | |
| function remove_header_cols($header_columns) | |
| { | |
| if ( isset($header_columns['rent']) ) { unset($header_columns['rent']); } | |
| if ( isset($header_columns['availability']) ) { unset($header_columns['availability']); } | |
| return $header_columns; | |
| } | |
| add_filter( 'propertyhive_import_kato_units_description_table_data_columns', 'remove_data_cols', 10, 3); |
NewerOlder