wc_translate_user_roles( string $translation, string $text, string $context, string $domain )
Translate WC roles using the woocommerce textdomain.
Description Description
Parameters Parameters
- $translation
-
(Required) Translated text.
- $text
-
(Required) Text to translate.
- $context
-
(Required) Context information for the translators.
- $domain
-
(Required) Text domain. Unique identifier for retrieving translated strings.
Return Return
(string)
Source Source
File: includes/wc-user-functions.php
function wc_translate_user_roles( $translation, $text, $context, $domain ) { // translate_user_role() only accepts a second parameter starting in WP 5.2. if ( version_compare( get_bloginfo( 'version' ), '5.2', '<' ) ) { return $translation; } if ( 'User role' === $context && 'default' === $domain && in_array( $text, array( 'Shop manager', 'Customer' ), true ) ) { return translate_user_role( $text, 'woocommerce' ); } return $translation; }
Changelog Changelog
Version | Description |
---|---|
3.7.0 | Introduced. |