Make WordPress Core


Ignore:
Timestamp:
10/11/2020 07:27:21 PM (4 years ago)
Author:
johnbillion
Message:

Networks and Sites: Extract into a new function the email that gets sent to the network administrator when a new site is created, and introduce filters to disable and modify its

contents.

  • The send_new_site_email filter can be used to disable this email.
  • The new_site_email filter can be used to modify its contents.

Props Dhruvin, Dharm1025, dharmin16, jipmoors

Fixes #42134

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/network/site-new.php

    r47853 r49127  
    146146        }
    147147
    148         wp_mail(
    149             get_site_option( 'admin_email' ),
    150             sprintf(
    151                 /* translators: New site notification email subject. %s: Network title. */
    152                 __( '[%s] New Site Created' ),
    153                 get_network()->site_name
    154             ),
    155             sprintf(
    156                 /* translators: New site notification email. 1: User login, 2: Site URL, 3: Site title. */
    157                 __(
    158                     'New site created by %1$s
    159 
    160 Address: %2$s
    161 Name: %3$s'
    162                 ),
    163                 $current_user->user_login,
    164                 get_site_url( $id ),
    165                 wp_unslash( $title )
    166             ),
    167             sprintf(
    168                 'From: "%1$s" <%2$s>',
    169                 _x( 'Site Admin', 'email "From" field' ),
    170                 get_site_option( 'admin_email' )
    171             )
    172         );
     148        wpmu_new_site_admin_notification( $id, $user_id );
    173149        wpmu_welcome_notification( $id, $user_id, $password, $title, array( 'public' => 1 ) );
    174150        wp_redirect(
Note: See TracChangeset for help on using the changeset viewer.