plugin_locale
云策文档标注
概述
plugin_locale 是一个 WordPress 过滤器,用于修改插件的本地化语言设置。它允许开发者动态调整插件的翻译区域,基于文本域等参数。
关键要点
- plugin_locale 过滤器用于过滤插件的当前区域设置(locale)。
- 参数包括 $locale(字符串,插件的当前区域)和 $domain(字符串,文本域,用于检索翻译字符串的唯一标识符)。
- 该过滤器在 WordPress 3.0.0 版本中引入。
- 注意:有用户反馈指出,在 WordPress 6.7 版本中此过滤器可能已被移除,使用时需检查版本兼容性。
原文内容
Filters a plugin’s locale.
Parameters
$localestring-
The plugin’s current locale.
$domainstring-
Text domain. Unique identifier for retrieving translated strings.
Source
} elseif ( false !== $deprecated ) {
Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |
Skip to note 2 content
Room 34 Creative Services, LLC
I found out the hard way that this filter was removed in WP 6.7.