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_property_imported_blm", 'set_inv_dept', 10, 2 ); | |
function set_inv_dept($post_id, $property) | |
{ | |
$investment = false; | |
for ( $i = 1; $i <= 10; ++$i ) | |
{ | |
if ( | |
isset($property['FEATURE' . $i]) && | |
strpos( strtolower(trim($property['FEATURE' . $i])), 'investment' ) !== FALSE |
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 houzez_get_property_gallery($size = 'thumbnail') | |
{ | |
global $post; | |
if ( ! houzez_option('disable_property_gallery', 1) ) { | |
return; | |
} | |
if ( get_post_meta($post->ID, 'images_stored_as_urls', true) === '1' ) | |
{ |
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_results_orderby', 'add_name_order' ); | |
function add_name_order( $orders ) | |
{ | |
$orders['address_name_number-asc'] = 'Name - Low To High'; | |
$orders['address_name_number-desc'] = 'Name - High To Low'; | |
return $orders; | |
} | |
add_filter( 'propertyhive_get_search_results_ordering_args', 'order_by_name' ); | |
function order_by_name($args) |
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_property_imported_blm", "set_exempt_custom_field", 10, 2 ); | |
function set_exempt_custom_field($post_id, $property) | |
{ | |
if ( isset($property['COUNCIL_TAX_EXEMPT']) && $property['COUNCIL_TAX_EXEMPT'] == '1' ) | |
{ | |
update_post_meta( $post_id, '_council_tax_exempt', 'Yes' ); | |
} | |
else | |
{ | |
update_post_meta( $post_id, '_council_tax_exempt', 'No' ); |
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 screddit_filter_single_elementor_template($manager) | |
{ | |
if (ElementorPro\Modules\ThemeBuilder\Module::is_preview()) // Do not change content when editing. | |
return; | |
$theme_builder = ElementorPro\Modules\ThemeBuilder\Module::instance(); | |
$current_template = $theme_builder->get_conditions_manager()->get_documents_for_location('single'); | |
if (is_singular('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_action( 'elementor/query/investmentquery', 'elementor_query_investment_only' ); | |
function elementor_query_investment_only( $query ) | |
{ | |
PH()->query->property_query( $query ); | |
// Set the custom post type | |
$query->set( 'post_type', [ 'property' ] ); | |
$tax_query = $query->get('tax_query'); | |
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_images_stored_as_urls', 'stores_media_urls', 10, 4); | |
function stores_media_urls($stored_as_urls, $post_id, $property, $import_id) | |
{ | |
return true; | |
} |
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_property_imported_vebra_api_xml", "correct_property_auction_department", 10, 2 ); | |
function correct_property_auction_department($post_id, $property) | |
{ | |
$price_attributes = $property->price->attributes(); | |
if ( isset($price_attributes['qualifier']) && strpos(strtolower($price_attributes['qualifier']), 'auction') !== false ) | |
{ | |
update_post_meta( $post_id, '_department', 'auction' ); | |
} | |
} |
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 screddit_filter_single_elementor_template($manager) | |
{ | |
if (ElementorPro\Modules\ThemeBuilder\Module::is_preview()) // Do not change content when editing. | |
return; | |
$theme_builder = ElementorPro\Modules\ThemeBuilder\Module::instance(); | |
$current_template = $theme_builder->get_conditions_manager()->get_documents_for_location('single'); | |
if (is_singular('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 custom_rewrite_basic() { | |
// The following rule maps /locations/east/ to the search results page with a specific location ID | |
add_rewrite_rule('^locations/east/?$', 'index.php?pagename=search_results&location=241', 'top'); | |
} | |
add_action('init', 'custom_rewrite_basic'); | |
function register_query_vars( $vars ) { | |
$vars[] = 'location'; // Add 'location' to the recognized query vars | |
return $vars; | |
} |
NewerOlder