Switch language

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




newuser_notify_siteadmin [ WordPress Function ]

newuser_notify_siteadmin ( $user_id )
Parameters:
  • (int) $user_id The new user's ID.
Uses:
Returns:
  • (bool)
Defined at:



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

Filter 'newuser_notify_siteadmin' to change the content of the notification email.

Source


<?php
function newuser_notify_siteadmin$user_id ) {
    if ( 
get_site_option'registrationnotification' ) != 'yes' )
        return 
false;

    
$email get_site_option'admin_email' );

    if ( 
is_email($email) == false )
        return 
false;

    
$user = new WP_User($user_id);

    
$options_site_url esc_url(network_admin_url('settings.php'));
    
$msg sprintf(__('New User: %1s
Remote IP: %2s

Disable these notifications: %3s'
), $user->user_login$_SERVER['REMOTE_ADDR'], $options_site_url);

    
$msg apply_filters'newuser_notify_siteadmin'$msg$user );
    
wp_mail$emailsprintf(__('New User Registration: %s'), $user->user_login), $msg );
    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