wp_set_script_translations
函数
wp_set_script_translations ( $handle, $domain = 'default', $path = '' )
- 参数
-
-
(string)
$handle
Script handle the textdomain will be attached to.- Required: 是
-
(string)
$domain
Optional. Text domain. Default ‘default’.- Required: 否
- Default: ‘default’
-
(string)
$path
Optional. The full file path to the directory containing translation files.- Required: 否
- Default: (empty)
-
(string)
- 返回值
-
- (bool) True if the text domain was successfully localized, false otherwise.
- 相关
-
- WP_Scripts::set_translations()
- 定义位置
-
-
wp-includes/functions.wp-scripts.php
, line 240
-
wp-includes/functions.wp-scripts.php
- 引入
- 5.0.0
- 弃用
- –
Sets translated strings for a script.
Works only if the script has already been registered.
function wp_set_script_translations( $handle, $domain = 'default', $path = '' ) { global $wp_scripts; if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { _wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle ); return false; } return $wp_scripts->set_translations( $handle, $domain, $path ); }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。