WordPress.org

Make WordPress Core

Ticket #24411: site-new.php.diff

File site-new.php.diff, 1.2 KB (added by tomk-m, 22 months ago)

Patch to respect registrationnotification setting

  • site-new.php

    old new  
    8585        if ( !is_wp_error( $id ) ) { 
    8686                if ( !is_super_admin( $user_id ) && !get_user_option( 'primary_blog', $user_id ) ) 
    8787                        update_user_option( $user_id, 'primary_blog', $id, true ); 
    88                 $content_mail = sprintf( __( 'New site created by %1$s 
     88 
     89                if ( get_site_option( 'registrationnotification' ) == 'yes' ) { 
     90                        $content_mail = sprintf( __( 'New site created by %1$s 
    8991 
    9092Address: %2$s 
    9193Name: %3$s' ), $current_user->user_login , get_site_url( $id ), wp_unslash( $title ) ); 
    92                 wp_mail( get_site_option('admin_email'), sprintf( __( '[%s] New Site Created' ), $current_site->site_name ), $content_mail, 'From: "Site Admin" <' . get_site_option( 'admin_email' ) . '>' ); 
     94                        wp_mail( get_site_option('admin_email'), sprintf( __( '[%s] New Site Created' ), $current_site->site_name ), $content_mail, 'From: "Site Admin" <' . get_site_option( 'admin_email' ) . '>' ); 
     95                } 
    9396                wpmu_welcome_notification( $id, $user_id, $password, $title, array( 'public' => 1 ) ); 
    9497                wp_redirect( add_query_arg( array( 'update' => 'added', 'id' => $id ), 'site-new.php' ) ); 
    9598                exit;