Created
August 13, 2025 06:46
-
-
Save propertyhive/87ac81d75c71604e0f87409a30c56f99 to your computer and use it in GitHub Desktop.
This file contains hidden or 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_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