pre_load_script_translations

过滤钩子
apply_filters( 'pre_load_script_translations', null, $file, $handle, $domain )
参数
  • (string|false|null) $translations JSON-encoded translation data. Default null.
    Required:
  • (string|false) $file Path to the translation file to load. False if there isn't one.
    Required:
  • (string) $handle Name of the script to register a translation domain to.
    Required:
  • (string) $domain The text domain.
    Required:
定义位置
相关勾子
load_script_translationsload_script_translation_fileasync_update_translationwp_mce_translationdeleted_site_transient
相关方法
load_script_translationswp_set_script_translationswp_load_translations_earlyload_script_textdomainlist_translation_updateswp_load_alloptions
引入
5.0.2
弃用
-

pre_load_script_translations – 这个钩子在脚本翻译被加载之前被调用。开发者可以使用这个钩子来加载自定义的翻译或修改需要翻译的脚本列表。

预先筛选给定文件、脚本句柄和文本域的脚本翻译。

返回非空值允许重写默认逻辑,从而有效地短路函数。

$translations = apply_filters( 'pre_load_script_translations', null, $file, $handle, $domain );

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-14 12:36:31

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: