Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( "propertyhive_property_imported_realla_json", "correct_realla_property_availability", 10, 2 );
- function correct_realla_property_availability($post_id, $property)
- {
- if ( $property['transaction_type'] == 'for_rent' )
- {
- wp_suspend_cache_invalidation( false );
- wp_defer_term_counting( false );
- wp_defer_comment_counting( false );
- if ( isset($property['sale_stage']) && $property['sale_stage'] == 'sold_or_let' ) // Let
- {
- wp_delete_object_term_relationships( $post_id, 'availability' );
- wp_set_post_terms( $post_id, 112, 'availability' );
- }
- wp_suspend_cache_invalidation( true );
- wp_defer_term_counting( true );
- wp_defer_comment_counting( true );
- }
- }
Add Comment
Please, Sign In to add comment