Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wpmu_welcome_notification [ WordPress Function ]

wpmu_welcome_notification ( $blog_id, $user_id, $password, $title, $meta = '' )
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.
Returns:
  • (bool)
Defined at:



Notify a user that her blog activation has been successful.

Filter 'wpmu_welcome_notification' to disable or bypass.

Filter 'update_welcome_email' and 'update_welcome_subject' to modify the content and subject line of the notification email.

Source


<?php
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 stripslashesget_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_htmlget_site_option'site_name' ) );
    
$message_headers "From: \"{$from_name}\" <{$admin_email}>\n" "Content-Type: text/plain; charset=\"" get_option('blog_charset') . "\"\n";
    
$message $welcome_email;

    if ( empty( 
$current_site->site_name ) )
        
$current_site->site_name 'WordPress';

    
$subject apply_filters'update_welcome_subject'sprintf(__('New %1$s Site: %2$s'), $current_site->site_namestripslashes$title ) ) );
    
wp_mail($user->user_email$subject$message$message_headers);
    return 
true;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics