WordPress.org

Make WordPress Core

Ticket #20764: 20764.diff

File 20764.diff, 1.9 KB (added by kobenland, 6 years ago)
  • wp-admin/user-new.php

     
    1818
    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,
    2325You\'ve been invited to join \'%1$s\' at
     
    2628this email. This invitation will expire in a few days.
    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(), esc_html( translate_user_role( $role[ 'name' ] ) ) );
    3032        }
    3133        add_filter( 'wpmu_signup_user_notification_email', 'admin_created_user_email' );
    3234
     
    7274                } else {
    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,
    7782
     
    8085
    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(), esc_html( translate_user_role( $role[ 'name' ] ) ), home_url("/newbloguser/$newuser_key/")));
    8489                        $redirect = add_query_arg( array('update' => 'add'), 'user-new.php' );
    8590                }
    8691        }