translate_user_role
函数
translate_user_role ( $name, $domain = 'default' )
- 参数
-
-
(string)
$name
The role name.- Required: 是
-
(string)
$domain
Optional. Text domain. Unique identifier for retrieving translated strings. Default ‘default’.- Required: 否
- Default: ‘default’
-
(string)
- 返回值
-
- (string) Translated role name on success, original name on failure.
- 定义位置
-
-
wp-includes/l10n.php
, line 1350
-
wp-includes/l10n.php
- 引入
- 2.8.0
- 弃用
- –
Translates role name.
Since the role names are in the database and not in the source there
are dummy gettext calls to get them into the POT file and this function
properly translates them back.
The before_last_bar() call is needed, because older installations keep the roles
using the old context format: ‘Role name|User role’ and just skipping the
content after the last bar is easier than fixing them in the DB. New installations
won’t suffer from that problem.
function translate_user_role( $name, $domain = 'default' ) { return translate_with_gettext_context( before_last_bar( $name ), 'User role', $domain ); }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。