Skip to content

Instantly share code, notes, and snippets.

@propertyhive
Created August 13, 2025 06:46
Show Gist options
  • Save propertyhive/87ac81d75c71604e0f87409a30c56f99 to your computer and use it in GitHub Desktop.
Save propertyhive/87ac81d75c71604e0f87409a30c56f99 to your computer and use it in GitHub Desktop.
add_action( "propertyhive_property_imported_street_json", 'set_buyer_report', 10, 2 );
function set_buyer_report($post_id, $property)
{
if ( isset($property['attributes']['property_urls']) && !empty($property['attributes']['property_urls']) )
{
foreach ( $property['attributes']['property_urls'] as $url )
{
if ( $url['media_type'] == 'brochure' )
{
update_post_meta( $post_id, '_buyer_report', $url['media_url'] );
break;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment