Switch language

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




wpmu_signup_user_notification [ WordPress Function ]

wpmu_signup_user_notification ( $user, $user_email, $key, $meta = '' )
Parameters:
  • (string) $user The user's login name.
  • (string) $user_email The user's email address.
  • (array) $meta By default, an empty array.
  • (string) $key The activation key created in wpmu_signup_user()
Returns:
  • (bool)
Defined at:



Notify user of signup success.

This is the notification function used when no new site has been requested.

Filter 'wpmu_signup_user_notification' to bypass this function or replace it with your own notification behavior.

Filter 'wpmu_signup_user_notification_email' and 'wpmu_signup_user_notification_subject' to change the content and subject line of the email sent to newly registered users.

Source


<?php
function wpmu_signup_user_notification($user$user_email$key$meta '') {
    if ( !
apply_filters('wpmu_signup_user_notification'$user$user_email$key$meta) )
        return 
false;

    
// Send email with activation link.
    
$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 sprintf(
        
apply_filters'wpmu_signup_user_notification_email',
            
__"To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\n" ),
            
$user$user_email$key$meta
        
),
        
site_url"wp-activate.php?key=$key)
    );
    
// TODO: Don't hard code activation link.
    
$subject sprintf(
        
apply_filters'wpmu_signup_user_notification_subject',
            
__'[%1$s] Activate %2$s' ),
            
$user$user_email$key$meta
        
),
        
$from_name,
        
$user
    
);
    
wp_mail($user_email$subject$message$message_headers);
    return 
true;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



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