Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save propertyhive/e16ecb102246f85e62d58687af737152 to your computer and use it in GitHub Desktop.

Select an option

Save propertyhive/e16ecb102246f85e62d58687af737152 to your computer and use it in GitHub Desktop.
add_action( "houzez_property_feed_property_imported_kyero", 'extract_features', 10, 4 );
function extract_features($post_id, $property, $import_id, $instance_id)
{
$garages = '';
if ( isset($property->features->feature) )
{
foreach ( $property->features->feature as $feature )
{
$text = trim((string)$feature);
if (stripos($text, 'Private garage') === 0)
{
$parts = explode(':', $text);
if (isset($parts[1]))
{
$garages = trim($parts[1]);
}
}
}
}
if ($garages !== '')
{
update_post_meta($post_id, 'fave_property_garage', $garages);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment