unload_textdomain
云策文档标注
概述
unload_textdomain 是一个 WordPress 动作钩子,在卸载文本域之前触发,用于处理翻译字符串的卸载过程。
关键要点
- 钩子名称:unload_textdomain
- 触发时机:在卸载文本域之前执行
- 参数:$domain(文本域的唯一标识符)和 $reloadable(布尔值,指示文本域是否可以即时重新加载)
- 相关函数:unload_textdomain() 用于卸载文本域的翻译
- 版本变更:WordPress 6.1.0 引入了 $reloadable 参数,3.0.0 版本首次引入此钩子
原文内容
Fires before the text domain is unloaded.
Parameters
$domainstring-
Text domain. Unique identifier for retrieving translated strings.
$reloadablebool-
Whether the text domain can be loaded just-in-time again.
Source
do_action( 'unload_textdomain', $domain, $reloadable );