| 1256 | * Notify the network administration email that a new blog has been created on the network. |
| 1257 | * |
| 1258 | * Filter 'wpmu_admin_new_site_notification' to disable or bypass. |
| 1259 | * |
| 1260 | * Filter 'update_new_site_notification_email' and 'update_new_site_notification_subject' to |
| 1261 | * modify the content and subject line of the notification email. |
| 1262 | * |
| 1263 | * @since MU |
| 1264 | * |
| 1265 | * @param string $user_name The user who created the new blog |
| 1266 | * @param string $address The new blog's URL |
| 1267 | * @param string $title The new blog's title |
| 1268 | * @return bool |
| 1269 | */ |
| 1270 | function wpmu_admin_new_site_notification( $user_name, $address, $title ) { |
| 1271 | global $current_site; |
| 1272 | |
| 1273 | if ( !apply_filters('wpmu_admin_new_site_notification', $user_name, $address, $title) ) |
| 1274 | return false; |
| 1275 | |
| 1276 | $content_mail = sprintf( __( 'New site created by %1$s |
| 1277 | |
| 1278 | Address: %2$s |
| 1279 | Name: %3$s' ), $user_name , $address, wp_unslash($title) ); |
| 1280 | |
| 1281 | $content_mail = apply_filters( 'update_new_site_notification_email', $user_name, $add, $title); |
| 1282 | |
| 1283 | $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) ); |
| 1284 | $from_email = get_site_option( 'admin_email' ); |
| 1285 | |
| 1286 | $message_headers = "From: \"{$from_name}\" <{$from_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; |
| 1287 | $message = $content_mail; |
| 1288 | |
| 1289 | if ( empty( $current_site->site_name ) ) |
| 1290 | $current_site->site_name = 'WordPress'; |
| 1291 | |
| 1292 | $subject = apply_filters( 'update_new_site_notification_subject', sprintf( __('[%s] New Site Created' ), $current_site->site_name) ); |
| 1293 | wp_mail( get_site_option( 'admin_email' ), $subject, $message, $message_headers ); |
| 1294 | return true; |
| 1295 | } |
| 1296 | |
| 1297 | /** |