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; | |
} |
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('template_include', 'custom_property_template_redirect', 99); | |
function custom_property_template_redirect($template) { | |
if (is_singular('property')) { | |
$department = get_post_meta(get_the_ID(), '_department', true); | |
if ('auction' === $department) { | |
$template_id = 123; // ID of your Elementor template for 'auction' | |
} else { | |
$template_id = 456; // ID of your Elementor template for others | |
} | |
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_property_import_rtdf_mandatory_fields_send', 'custom_mandatory_rtdf_fields' ); | |
function custom_mandatory_rtdf_fields($mandatory_fields) | |
{ | |
unset($mandatory_fields['property']['address']['house_name_number']); | |
return $mandatory_fields; | |
} |
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_caldes_xml", 'append_brochure_17_to_description', 10, 2 ); | |
function append_brochure_17_to_description($post_id, $property) | |
{ | |
$descriptions = 0; | |
if ( (string)$property->brochure_text !== '' ) { | |
update_post_meta( $post_id, '_description_name_' . $descriptions, '' ); | |
update_post_meta( $post_id, '_description_' . $descriptions, (string)$property->brochure_text ); | |
++$descriptions; | |
} | |
if ( (string)$property->brochure_17 !== '' ) { |
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_shortcode( 'propertyhive_map_search_custom', 'propertyhive_map_search_custom_shortcode' ); | |
function propertyhive_map_search_custom_shortcode( $atts ) | |
{ | |
global $wp_query, $post, $wpdb; | |
$query = $wp_query->request; | |
$current_settings = get_option( 'propertyhive_map_search', array() ); | |
$additional_attributes = ''; |
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_shortcode_properties_query', 'filter_shortcode_by_language', 10, 2 ); | |
add_filter( 'propertyhive_shortcode_recent_properties_query', 'filter_shortcode_by_language', 10, 2 ); | |
add_filter( 'propertyhive_shortcode_featured_properties_query', 'filter_shortcode_by_language', 10, 2 ); | |
add_filter( 'propertyhive_shortcode_similar_properties_query', 'filter_shortcode_by_language', 10, 2 ); | |
function filter_shortcode_by_language($args, $atts) | |
{ | |
// Get the current language | |
$current_language = apply_filters( 'wpml_current_language', NULL ); | |
$tax_query = ( ( isset($args['tax_query']) && is_array($args['tax_query']) ) ? $args['tax_query'] : 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( 'propertyhive_get_search_results_ordering_args', 'order_by_date_old' ); | |
function order_by_date_old($args) | |
{ | |
if ( isset( $_GET['orderby'] ) && $_GET['orderby'] != '' ) | |
{ | |
$orderby_value = explode( '-', $_GET['orderby'] ); | |
$orderby = esc_attr( $orderby_value[0] ); | |
$order = ! empty( $orderby_value[1] ) ? $orderby_value[1] : 'DESC'; | |
switch ( $orderby ) |
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', 'run_media_queue', 1 ); | |
function run_media_queue() | |
{ | |
do_action('phpropertydownloadimportmediacronhook'); | |
} |
NewerOlder