Skip to content

Instantly share code, notes, and snippets.

View gist:e89abc8c63339294e4a94b31d518575c
add_filter( 'propertyhive_property_query_meta_query', 'exclude_completed_more_than_six_months', 10, 2 );
function exclude_completed_more_than_six_months($meta_querys, $q)
{
$meta_querys[] = array(
'relation' => 'OR',
array(
'key' => '_completion_date',
'compare' => 'NOT EXISTS'
),
array(
View gist:b981ff2a168a2c96c4e066d068196469
add_action( "propertyhive_property_imported_jet", 'import_completion_date', 10, 2 );
function import_completion_date($post_id, $property)
{
$completion_date = '';
if ( isset($property->CompletionDate) && !empty( (string)$property->CompletionDate ) )
{
$completion_date = (string)$property->CompletionDate;
}
update_post_meta( $post_id, '_completion_date', $completion_date );
}
View gist:63d964f6869db1bebd6e0ede26b41d38
add_action( "propertyhive_property_imported_vaultea_json", 'import_custom_fields', 10, 2 );
function import_custom_fields( $post_id, $property )
{
$three_year_residency = '';
$cat_2_not_applicable = '';
$hepps_not_applicable = '';
if ( isset($property['custom']) && !empty($property['custom']) )
{
foreach ( $property['custom'] as $custom )
View gist:77fb1db8d361386df1b759e192a6a078
.propertyhive-result-count,
.propertyhive-views {
margin-right: 4.347826087%;
float: left;
width: 30.4347826087%;
margin-bottom: 1.41575em;
}
.propertyhive-views ul {
list-style-type: none;
margin: 0;
View gist:b978b1d1664bbcda592fc0789e8fbff4
add_action( "propertyhive_property_imported_vebra_api_xml", 'set_alto_area', 10, 2 );
function set_alto_area( $post_id, $property )
{
update_post_meta( $post_id, '_area_max', '' );
if ( isset($property->area->max) && !empty((string)$property->area->max) )
{
update_post_meta( $post_id, '_area_max', (string)$property->area->max );
}
else
{
@propertyhive
propertyhive / gist:75a74c11e48abc1d5fcf3199baba3473
Created Nov 23, 2022
Import and set featured from Reapit Foundations
View gist:75a74c11e48abc1d5fcf3199baba3473
add_filter( 'propertyhive_reapit_foundations_json_properties_url_parameters', 'extra_fields_in_reapit' );
function extra_fields_in_reapit( $url_parameters )
{
$url_parameters['extrasField'] = array( 'pFeaturedProperty' );
return $url_parameters;
}
@propertyhive
propertyhive / gist:3396dd809965dd3316097d3cf68ef59c
Created Nov 22, 2022
Enable obtaining VaultEA custom fields
View gist:3396dd809965dd3316097d3cf68ef59c
add_filter( 'propertyhive_property_import_vaultea_custom', 'obtain_custom' );
function obtain_custom($obtain)
{
return true;
}
View gist:eb3b0752602e983b9cae2b61ac70624e
.propertyhive-result-count,
.propertyhive-views {
margin-right: 4.347826087%;
float: left;
width: 30.4347826087%;
margin-bottom: 1.41575em;
}
.propertyhive-views ul {
list-style-type: none;
margin: 0;
@propertyhive
propertyhive / gist:59f181fa138f85c0f1d7240e4aac2b40
Created Nov 17, 2022
Only include to let unavailable in Reapit / Jet feed
View gist:59f181fa138f85c0f1d7240e4aac2b40
add_filter( "propertyhive_jet_properties_due_import", 'sort_properties_to_import' );
function sort_properties_to_import($properties)
{
$new_properties = array();
foreach ( $properties as $property )
{
if ( (string)$property->Available == '1' )
{
// available, do nothing as we want to skip these
continue;
View gist:b0e4a11e35df3cc0b549808007fe5be2
add_action( "propertyhive_property_imported_street_json", 'custom_street_hook', 10, 2 );
function custom_street_hook($post_id, $property)
{
// do stuff here. e.g:
// update_post_meta( $post_id, '_my_custom_field', $property['street_field'] );
// var_dump($property);
}