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/onmarketpropertyquery', 'remove_sold_from_elementor_query', 99 ); | |
function remove_sold_from_elementor_query( $query ) | |
{ | |
$tax_query = $query->get('tax_query'); | |
$tax_query[] = array( | |
'taxonomy' => 'availability', | |
'terms' => array(15), | |
'operator' => 'NOT IN', | |
); |
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_query_tax_query', 'remove_sold', 10, 2 ); | |
function remove_sold( $tax_query, $query ) | |
{ | |
$tax_query[] = array( | |
'taxonomy' => 'availability', | |
'terms' => array(15), | |
'operator' => 'NOT IN', | |
); | |
return $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( 'kadence_blocks_pro_query_loop_query_vars', function( $query, $ql_query_meta, $ql_id ) { | |
// Change XXXX accordingly to QL ID. | |
// It looks like you can find this by navigating to 'Kadence Blocks > All Queries' | |
if ( $ql_id == XXXX ) | |
{ | |
$query['tax_query'] = array( | |
array( | |
'taxonomy' => 'property_type', | |
'field' => 'slug', |
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_upload_dir($uploads) { | |
if (isset($_REQUEST['post_id'])) { | |
$post_id = (int) $_REQUEST['post_id']; | |
$post = get_post($post_id); | |
if ($post && $post->post_type == 'property') { | |
$subdir = '/property'; | |
// Modify the upload directory paths | |
$uploads['subdir'] = $subdir; |
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
@media (max-width:767px) { | |
.propertyhive ul.properties li .thumbnail { float:none; width:100%; margin-bottom:20px; } | |
.propertyhive ul.properties li .details { float:none; width:100% } | |
} |
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_single_property_meta', 'add_location_to_meta' ); | |
function add_location_to_meta( $meta ) | |
{ | |
global $property; | |
$location = $property->location; | |
if ( $location != '' ) | |
{ | |
$meta['location'] = 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_property_query_meta_query', 'remove_department_constraint', 10, 2); | |
function remove_department_constraint( $meta_query, $q ) | |
{ | |
$new_meta_query = array(); | |
foreach ( $meta_query as $query ) | |
{ | |
if ( !isset($query['key']) || (isset( $query['key']) && $query['key'] != '_department') ) | |
{ | |
$new_meta_query[] = $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_action( "propertyhive_property_imported_rex_json", 'rex_import_stuff', 10, 2 ); | |
function rex_import_stuff($post_id, $property) | |
{ | |
if ( isset($property['listing_agent_1']['name']) && $property['listing_agent_1']['name'] != '' ) | |
{ | |
$args = array( | |
'post_type' => 'agent', | |
's' => $property['listing_agent_1']['name'], | |
'posts_per_page' => 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_action( "propertyhive_property_imported_jet", 'move_ctb_to_descriptions', 10, 2 ); | |
function move_ctb_to_descriptions($post_id, $property) | |
{ | |
$council_tax_description = ''; | |
// Remove from features | |
$features = array(); | |
if ( isset($property->AccommodationSummary) && is_array($property->AccommodationSummary) && !empty($property->AccommodationSummary) ) | |
{ |
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_user_details_form_fields', 'split_out_tel_in_reg_form' ); | |
function split_out_tel_in_reg_form($fields) | |
{ | |
// Step 1: Split the array at the position where the new element needs to be inserted | |
$position = array_search('telephone_number', array_keys($fields)); | |
$before = array_slice($fields, 0, $position, true); | |
$after = array_slice($fields, $position, null, true); | |
// Step 2: Define the new element | |
$new_element = array( |
NewerOlder