Last active
November 22, 2019 10:39
-
-
Save dexit/d7503457aa39e1ed9ccd3403e3d7f23a to your computer and use it in GitHub Desktop.
Wordpress Property Hive mark imported NEW BUILD propreties from VEBRA to later re-use
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_vebra_api_xml", "set_new_build_marketing_flag", 10, 2 ); | |
| function set_new_build_marketing_flag($post_id, $property) | |
| { | |
| $property_attributes = $property->attributes(); | |
| if ( (string)$property_attributes['database'] == '15' || (isset($property->newbuild) && $property->newbuild == true) ) | |
| { | |
| update_post_meta( $post_id, '_new_build', '1' ); | |
| } | |
| else | |
| { | |
| update_post_meta( $post_id, '_new_build', '' ); | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The only question then is how to use the [properties] shortcode to output these. Using [properties new_build="1"] wouldn't work by default. However.. I've just been working on a new version of the Template Assistant add on to support this which I'll release shortly.
If you check in a few hours and update the Template Assistant add on you should then be able to use the shortcode mentioned above,