This file contains 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
$my_post = array( | |
'ID' => $post_id, | |
'post_title' => wp_strip_all_tags( $unit_display_address ), | |
'post_excerpt' => ( ( isset($unit['short_description']) && $unit['short_description'] != '' ) ? $unit['short_description'] : '' ), | |
'post_content' => ( ( isset($unit['description']) && $unit['description'] != '' ) ? $unit['description'] : ( ( isset($unit['short_description']) && $unit['short_description'] != '' ) ? $unit['short_description'] : '' ) ), | |
); |
This file contains 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
<?php | |
$args = array( | |
'post_type' => 'property', | |
'fields' => 'ids', | |
'nopaging' => true, | |
'meta_query' => array( | |
array( | |
'key' => '_department', | |
'value' => 'village-and-country' | |
), |
This file contains 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
document.addEventListener('DOMContentLoaded', function() { | |
setTimeout(function() { default_lettings_button() }, 100 ); // delay execution of defaulting | |
}); | |
function default_lettings_button() | |
{ | |
var checked_department = jQuery('input[name="department"]:checked').val(); | |
if ( checked_department == 'residential-lettings' ) | |
{ | |
toggleActive(document.querySelector('.control-department label[for="department_residential-lettings"]')); |
This file contains 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_rest_api_property_fields', 'add_additional_fields_to_property_rest_api' ); | |
function add_additional_fields_to_property_rest_api($field_array) | |
{ | |
$field_array[] = 'address_name_number'; | |
return $field_array; | |
} |
This file contains 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_properties_due_import_rex", 'niche_homes_only', 10, 2 ); | |
function niche_homes_only( $properties, $import_id ) | |
{ | |
$new_properties = array(); | |
foreach ( $properties as $property ) | |
{ | |
if ( isset($property['account']['id']) && $property['account']['id'] == '4281' ) // 4281 = accountID for Niche Homes | |
{ | |
$new_properties[] = $property; |
This file contains 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 remove_just_listed_flag() { | |
$args = array( | |
'post_type' => 'property', | |
'posts_per_page' => -1, | |
'post_status' => 'publish', | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'marketing_flag', | |
'field' => 'slug', | |
'terms' => 'just-listed', |
This file contains 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_property_import_cron', 'download_caldes_xml' ); | |
function download_caldes_xml() | |
{ | |
$xml_url = 'https://example.com/path/to/your/caldes.xml'; // set to URL provided by Caldes | |
$local_dir = $_SERVER['DOCUMENT_ROOT'] . '/wp-content/uploads/ph_import'; // change accordingly to your setup | |
// Local file path | |
$local_file = $local_dir . '/caldes.xml'; | |
// Use file_get_contents to fetch the XML content |
This file contains 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
// optional if wanting to remove the default 'Make Enquiry' button | |
//remove_action( 'propertyhive_property_actions_list_start', 'propertyhive_make_enquiry_button', 10 ); | |
add_filter( 'propertyhive_single_property_actions', 'add_custom_make_enquiry_action' ); | |
function add_custom_make_enquiry_action( $actions ) | |
{ | |
global $property; | |
if ( strtolower($property->availability) == 'sold out' ) | |
{ |
This file contains 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/onmarketauctionpropertyquery', 'elementor_query_on_market_auction_only' ); | |
function elementor_query_on_market_auction_only( $query ) | |
{ | |
$_GET['department'] = 'auction'; | |
$_REQUEST['department'] = 'auction'; | |
PH()->query->property_query( $query ); | |
// Set the custom post type | |
$query->set( 'post_type', [ 'property' ] ); |
This file contains 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( 'ph_rtdf_floorplan_size', 'diff_fp_in_rtdf' ); | |
function diff_fp_in_rtdf( $size ) | |
{ | |
return 'full'; | |
} |
NewerOlder