Make WordPress Core

Changeset 39203


Ignore:
Timestamp:
11/11/2016 10:19:14 PM (8 years ago)
Author:
ocean90
Message:

Multisite: Rename the $user parameter to $user_login in wpmu_signup_blog_notification() and wpmu_signup_user_notification().

[38961] added a $user = get_user_by( 'login', $user ); call which was overriding the $user string variable for the login name. The change to $user_login makes this clear.

Props johnjamesjacoby.
Fixes #38763.

File:
1 edited

Legend:

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

    r38961 r39203  
    765765 * @param string $path       The new blog path.
    766766 * @param string $title      The site title.
    767  * @param string $user      The user's login name.
     767 * @param string $user_login The user's login name.
    768768 * @param string $user_email The user's email address.
    769769 * @param string $key        The activation key created in wpmu_signup_blog()
     
    771771 * @return bool
    772772 */
    773 function wpmu_signup_blog_notification( $domain, $path, $title, $user, $user_email, $key, $meta = array() ) {
     773function wpmu_signup_blog_notification( $domain, $path, $title, $user_login, $user_email, $key, $meta = array() ) {
    774774    /**
    775775     * Filters whether to bypass the new site email notification.
     
    780780     * @param string      $path       Site path.
    781781     * @param string      $title      Site title.
    782      * @param string      $user      User login name.
     782     * @param string      $user_login User login name.
    783783     * @param string      $user_email User email address.
    784784     * @param string      $key        Activation key created in wpmu_signup_blog().
    785785     * @param array       $meta       By default, contains the requested privacy setting and lang_id.
    786786     */
    787     if ( ! apply_filters( 'wpmu_signup_blog_notification', $domain, $path, $title, $user, $user_email, $key, $meta ) ) {
     787    if ( ! apply_filters( 'wpmu_signup_blog_notification', $domain, $path, $title, $user_login, $user_email, $key, $meta ) ) {
    788788        return false;
    789789    }
     
    802802    $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
    803803
    804     $user = get_user_by( 'login', $user );
     804    $user = get_user_by( 'login', $user_login );
    805805    $switched_locale = switch_to_locale( get_user_locale( $user ) );
    806806
     
    817817         * @param string $path       Site path.
    818818         * @param string $title      Site title.
    819          * @param string $user      User login name.
     819         * @param string $user_login User login name.
    820820         * @param string $user_email User email address.
    821821         * @param string $key        Activation key created in wpmu_signup_blog().
     
    824824        apply_filters( 'wpmu_signup_blog_notification_email',
    825825            __( "To activate your blog, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\nAfter you activate, you can visit your site here:\n\n%s" ),
    826             $domain, $path, $title, $user, $user_email, $key, $meta
     826            $domain, $path, $title, $user_login, $user_email, $key, $meta
    827827        ),
    828828        $activate_url,
     
    841841         * @param string $path       Site path.
    842842         * @param string $title      Site title.
    843          * @param string $user      User login name.
     843         * @param string $user_login User login name.
    844844         * @param string $user_email User email address.
    845845         * @param string $key        Activation key created in wpmu_signup_blog().
     
    848848        apply_filters( 'wpmu_signup_blog_notification_subject',
    849849            __( '[%1$s] Activate %2$s' ),
    850             $domain, $path, $title, $user, $user_email, $key, $meta
     850            $domain, $path, $title, $user_login, $user_email, $key, $meta
    851851        ),
    852852        $from_name,
     
    877877 * @since MU
    878878 *
    879  * @param string $user      The user's login name.
     879 * @param string $user_login The user's login name.
    880880 * @param string $user_email The user's email address.
    881881 * @param string $key        The activation key created in wpmu_signup_user()
     
    883883 * @return bool
    884884 */
    885 function wpmu_signup_user_notification( $user, $user_email, $key, $meta = array() ) {
     885function wpmu_signup_user_notification( $user_login, $user_email, $key, $meta = array() ) {
    886886    /**
    887887     * Filters whether to bypass the email notification for new user sign-up.
     
    889889     * @since MU
    890890     *
    891      * @param string $user      User login name.
     891     * @param string $user_login User login name.
    892892     * @param string $user_email User email address.
    893893     * @param string $key        Activation key created in wpmu_signup_user().
    894894     * @param array  $meta       Signup meta data.
    895895     */
    896     if ( ! apply_filters( 'wpmu_signup_user_notification', $user, $user_email, $key, $meta ) )
     896    if ( ! apply_filters( 'wpmu_signup_user_notification', $user_login, $user_email, $key, $meta ) )
    897897        return false;
    898898
    899     $user = get_user_by( 'login', $user );
     899    $user = get_user_by( 'login', $user_login );
    900900    $switched_locale = switch_to_locale( get_user_locale( $user ) );
    901901
     
    915915         *
    916916         * @param string $content    Content of the notification email.
    917          * @param string $user      User login name.
     917         * @param string $user_login User login name.
    918918         * @param string $user_email User email address.
    919919         * @param string $key        Activation key created in wpmu_signup_user().
     
    922922        apply_filters( 'wpmu_signup_user_notification_email',
    923923            __( "To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login." ),
    924             $user, $user_email, $key, $meta
     924            $user_login, $user_email, $key, $meta
    925925        ),
    926926        site_url( "wp-activate.php?key=$key" )
     
    934934         *
    935935         * @param string $subject    Subject of the notification email.
    936          * @param string $user      User login name.
     936         * @param string $user_login User login name.
    937937         * @param string $user_email User email address.
    938938         * @param string $key        Activation key created in wpmu_signup_user().
     
    941941        apply_filters( 'wpmu_signup_user_notification_subject',
    942942            __( '[%1$s] Activate %2$s' ),
    943             $user, $user_email, $key, $meta
     943            $user_login, $user_email, $key, $meta
    944944        ),
    945945        $from_name,
    946         $user
     946        $user_login
    947947    );
    948948    wp_mail( $user_email, wp_specialchars_decode( $subject ), $message, $message_headers );
Note: See TracChangeset for help on using the changeset viewer.