// 更安全的缓存隔离方案
function zzw_isolated_post_html($post_id) {
// 创建独立缓存环境
$cache_handler = new WP_Object_Cache();
$original_cache = wp_cache_init();
// 设置独立缓存实例
wp_cache_init();
$GLOBALS['wp_object_cache'] = $cache_handler;
try {
return high_performance_post_html($post_id);
} finally {
// 恢复原始缓存
$GLOBALS['wp_object_cache'] = $original_cache;
wp_cache_init();
}
}
