wpmu_welcome_notification

Definition:
function wpmu_welcome_notification($blog_id, $user_id, $password, $title, $meta = '') {}

Notify a user that her blog activation has been successful.
Filter ‘wpmu_welcome_notification’ to disable or bypass.

Parameters

  • int $blog_id
  • int $user_id
  • string $password
  • string $title: The new blog’s title
  • array $meta: Optional. Not used in the default function, but is passed along to hooks for customization.

Defined filters

  • wpmu_welcome_notification
    apply_filters('wpmu_welcome_notification', $blog_id, $user_id, $password, $title, $meta)
  • update_welcome_email
    apply_filters( 'update_welcome_email', $welcome_email, $blog_id, $user_id, $password, $title, $meta)

Source code

function wpmu_welcome_notification($blog_id, $user_id, $password, $title, $meta = '') {

	global $current_site;



	if ( !apply_filters('wpmu_welcome_notification', $blog_id, $user_id, $password, $title, $meta) )

		return false;



	$welcome_email = stripslashes( get_site_option( 'welcome_email' ) );

	if ( $welcome_email == false )

		$welcome_email = stripslashes( __( 'Dear User,



Your new SITE_NAME site has been successfully set up at:

BLOG_URL



You can log in to the administrator account with the following information:

Username: USERNAME

Password: PASSWORD

Log in here: BLOG_URLwp-login.php



We hope you enjoy your new site. Thanks!



--The Team @ SITE_NAME' ) );



	$url = get_blogaddress_by_id($blog_id);

	$user = new WP_User($user_id);



	$welcome_email = str_replace( 'SITE_NAME', $current_site->site_name, $welcome_email );

	$welcome_email = str_replace( 'BLOG_TITLE', $title, $welcome_email );

	$welcome_email = str_replace( 'BLOG_URL', $url, $welcome_email );

	$welcome_email = str_replace( 'USERNAME', $user->user_login, $welcome_email );

	$welcome_email = str_replace( 'PASSWORD', $password, $welcome_email );



	$welcome_email = apply_filters( 'update_welcome_email', $welcome_email, $blog_id, $user_id, $password, $title, $meta);

	$admin_email = get_site_option( 'admin_email' );



	if ( $admin_email == '' )

		$admin_email = 'support@' . $_SERVER['SERVER_NAME'];



	$from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );

	$message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";

3407

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: