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 – 這個鉤子在指令碼翻譯被載入之前被呼叫。開發者可以使用這個鉤子來載入自定義的翻譯或修改需要翻譯的指令碼列表。

預先篩選給定檔案、指令碼控制代碼和文字域的指令碼翻譯。

返回非空值允許重寫預設邏輯,從而有效地短路函式。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$translations = apply_filters( 'pre_load_script_translations', null, $file, $handle, $domain );
$translations = apply_filters( 'pre_load_script_translations', null, $file, $handle, $domain );
$translations = apply_filters( 'pre_load_script_translations', null, $file, $handle, $domain );

常見問題

FAQs
檢視更多 >