Make WordPress Core


Ignore:
Timestamp:
03/11/2019 08:31:46 PM (6 years ago)
Author:
ocean90
Message:

I18N: Add $domain argument to translate_user_role().

The text domain is optional and gets passed to translate_with_gettext_context().

Props johnjamesjacoby .
Fixes #38736.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/l10n.php

    r44514 r44830  
    12331233 *
    12341234 * @since 2.8.0
    1235  *
    1236  * @param string $name The role name.
     1235 * @since 5.2.0 Added the `$domain` parameter.
     1236 *
     1237 * @param string $name   The role name.
     1238 * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings.
     1239 *                       Default 'default'.
    12371240 * @return string Translated role name on success, original name on failure.
    12381241 */
    1239 function translate_user_role( $name ) {
    1240     return translate_with_gettext_context( before_last_bar( $name ), 'User role' );
     1242function translate_user_role( $name, $domain = 'default' ) {
     1243    return translate_with_gettext_context( before_last_bar( $name ), 'User role', $domain );
    12411244}
    12421245
Note: See TracChangeset for help on using the changeset viewer.