WordPress.org

Make WordPress Core

Changeset 21316


Ignore:
Timestamp:
07/24/2012 05:32:40 PM (8 years ago)
Author:
ryan
Message:

Translate role names in the new user notification email. Props obenland. fixes #20764

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/user-new.php

    r21003 r21316  
    1919if ( is_multisite() ) {
    2020    function admin_created_user_email( $text ) {
     21        $roles = get_editable_roles();
     22        $role = $roles[ $_REQUEST['role'] ];
    2123        /* translators: 1: Site name, 2: site URL, 3: role */
    2224        return sprintf( __( 'Hi,
     
    2729
    2830Please click the following link to activate your user account:
    29 %%s' ), get_bloginfo('name'), home_url(), esc_html( $_REQUEST[ 'role' ] ) );
     31%%s' ), get_bloginfo( 'name' ), home_url(), wp_specialchars_decode( translate_user_role( $role['name'] ) ) );
    3032    }
    3133    add_filter( 'wpmu_signup_user_notification_email', 'admin_created_user_email' );
     
    7375            $newuser_key = substr( md5( $user_id ), 0, 5 );
    7476            add_option( 'new_user_' . $newuser_key, array( 'user_id' => $user_id, 'email' => $user_details->user_email, 'role' => $_REQUEST[ 'role' ] ) );
     77           
     78            $roles = get_editable_roles();
     79            $role = $roles[ $_REQUEST['role'] ];
    7580            /* translators: 1: Site name, 2: site URL, 3: role, 4: activation URL */
    7681            $message = __( 'Hi,
     
    8186Please click the following link to confirm the invite:
    8287%4$s' );
    83             wp_mail( $new_user_email, sprintf( __( '[%s] Joining confirmation' ), get_option( 'blogname' ) ), sprintf($message, get_option('blogname'), home_url(), $_REQUEST[ 'role' ], home_url("/newbloguser/$newuser_key/")));
     88            wp_mail( $new_user_email, sprintf( __( '[%s] Joining confirmation' ), get_option( 'blogname' ) ), sprintf( $message, get_option( 'blogname' ), home_url(), wp_specialchars_decode( translate_user_role( $role['name'] ) ), home_url( "/newbloguser/$newuser_key/" ) ) );
    8489            $redirect = add_query_arg( array('update' => 'add'), 'user-new.php' );
    8590        }
Note: See TracChangeset for help on using the changeset viewer.