kmp->kinsta_cache_purge instanceof Cache_Purge ) { return; } if ( $this->kmp->kinsta_cache_purge->purge_single_happened ) { // Avoid multiple purges on the same request. return; } if ( true === $update && $this->isPostPublished( $postId ) ) { $this->kmp->kinsta_cache_purge->purge_single_happened = true; $this->kmp->kinsta_cache_purge->initiate_purge( $postId ); debug_log('Post cache clearing was initiated.', ['controller' => $this->name, 'post_id' => $postId]); } } private function isPostPublished(int $postId): bool { return ! wp_is_post_autosave( $postId ) && ! wp_is_post_revision( $postId ) && 'publish' === get_post_status( $postId ); } }