post_status ) { return; } RenderCache::invalidate_all(); } /** * Invalidate cache when a post lifecycle event occurs. * * @param int $post_id Post identifier. * * @return void */ public static function handle_post_change( int $post_id ): void { if ( $post_id <= 0 ) { return; } RenderCache::invalidate_all(); } /** * Invalidate cache when relevant options change. * * @param string $option Option name. * @param mixed $old_value Previous value. * @param mixed $value New value. * * @return void */ public static function handle_updated_option( string $option, $old_value, $value ): void { unset( $old_value, $value ); if ( ! in_array( $option, array( Constants::OPTION_MARKDOWN_FOR_AGENTS, Constants::OPTION_TOPIC_CLUSTER ), true ) ) { return; } RenderCache::invalidate_all(); } }