Created
September 3, 2025 16:05
-
-
Save propertyhive/cab367e7194dbee3b1a26f602e83500a 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_agentos_json", "set_new_home_flag", 10, 2 ); | |
function set_new_home_flag( $post_id, $property ) | |
{ | |
if ( isset($property['IsNewHome']) && $property['IsNewHome'] === true ) | |
{ | |
wp_suspend_cache_invalidation( true ); | |
wp_defer_term_counting( true ); | |
wp_defer_comment_counting( true ); | |
wp_set_post_terms( $post_id, 123, 'marketing_flag' ); // Set 123 to term ID of 'New Home' flag set in 'Property hive > Settings > Cutom Fields > Marketing Flags | |
wp_suspend_cache_invalidation( false ); | |
wp_defer_term_counting( false ); | |
wp_defer_comment_counting( false ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment