/** * Flush the Timeline Express cache when a property is marked as 'sold'. * * @param string $new_status New post status. * @param string $old_status Old post status. * @param object $post Post object. * * @return null */ function timeline_express_clear_transients_on_property_sold( $new_status, $old_status, $post ) { if ( 'property' !== $post->post_type || 'sold' !== $new_status ) { return; } // Post ID where the Timeline Express timeline exists delete_timeline_express_transients( 1234 ); } add_action( 'transition_post_status', 'timeline_express_clear_transients_on_property_sold', 10, 3 );