Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save propertyhive/2ab0b41a94a54f962250311347c91eee to your computer and use it in GitHub Desktop.
Save propertyhive/2ab0b41a94a54f962250311347c91eee to your computer and use it in GitHub Desktop.
add_action( "propertyhive_sturents_property_imported", 'set_status_on_sturents', 10, 2 );
function set_status_on_sturents( $post_id, $property )
{
wp_suspend_cache_invalidation( true );
wp_defer_term_counting( true );
wp_defer_comment_counting( true );
wp_set_post_terms( $post_id, 5, 'availability' ); // Change 5 accordingly to new 'For Sale' status
wp_suspend_cache_invalidation( false );
wp_defer_term_counting( false );
wp_defer_comment_counting( false );
}
add_filter( 'propertyhive_add_property_availability_change_note', 'disable_history_logging' );
function disable_history_logging( $disabled )
{
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment