file_log("Cache for associated Polylang translation posts for Title: {{title}} have been purged", $deleted_post_id); } /** * Deletes cache files for all connected languages for a post feed. * * @param int $deleted_post_id Post id whose cache file for feed is already deleted. */ public function polylang_delete_post_feed_cache_for_all_languages($deleted_post_id) { // Check if polylang translation function is available if (!function_exists('pll_get_post_translations')) { return; } $translated_post_ids = pll_get_post_translations($deleted_post_id); $is_cache_purged = false; // Delete cache for each translated post foreach ($translated_post_ids as $post_id) { if ($deleted_post_id !== $post_id) { WPO_Page_Cache::really_delete_post_feed_cache($post_id); $is_cache_purged = true; } } if ($is_cache_purged) WPO_Page_Cache::instance()->file_log("Cache for associated Polylang translation posts' feeds for Title: {{title}} have been purged", $deleted_post_id); } }