newblog_notify_siteadmin

Notifies the network admin that a new site has been activated.

Description

newblog_notify_siteadmin( (int) $blog_id, (string) $deprecated = '' ); 

Filter to change the content of the notification email.

Parameters (2)

0. $blog_id (int)
The new site's ID.
1. $deprecated — Optional. (string) => ''
The deprecated.

Usage

  1. if ( !function_exists( 'newblog_notify_siteadmin' ) ) { 
  2. require_once ABSPATH . WPINC . '/ms-functions.php'; 
  3.  
  4. // The new site's ID. 
  5. $blog_id = -1; 
  6.  
  7. // The deprecated. 
  8. $deprecated = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = newblog_notify_siteadmin($blog_id, $deprecated); 
  12.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/ms-functions.php  
  1. function newblog_notify_siteadmin( $blog_id, $deprecated = '' ) { 
  2. if ( get_site_option( 'registrationnotification' ) != 'yes' ) 
  3. return false; 
  4.  
  5. $email = get_site_option( 'admin_email' ); 
  6. if ( is_email($email) == false ) 
  7. return false; 
  8.  
  9. $options_site_url = esc_url(network_admin_url('settings.php')); 
  10.  
  11. switch_to_blog( $blog_id ); 
  12. $blogname = get_option( 'blogname' ); 
  13. $siteurl = site_url(); 
  14.  
  15. /** translators: New site notification email. 1: Site URL, 2: User IP address, 3: Settings screen URL */ 
  16. $msg = sprintf( __( 'New Site: %1$s 
  17. URL: %2$s 
  18. Remote IP: %3$s 
  19.  
  20. Disable these notifications: %4$s' ), $blogname, $siteurl, wp_unslash( $_SERVER['REMOTE_ADDR'] ), $options_site_url); 
  21. /** 
  22. * Filters the message body of the new site activation email sent 
  23. * to the network administrator. 
  24. * @since MU 
  25. * @param string $msg Email body. 
  26. */ 
  27.  
  28. wp_mail( $email, sprintf( __( 'New Site Registration: %s' ), $siteurl ), $msg ); 
  29. return true;