Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_send_new_user_notification_to_admin

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
2108
2109           /**
2110            * Filters whether the admin is notified of a new user registration.
2111            *
2112            * @since 6.1.0
2113            *
2114            * @param bool    $send Whether to send the email. Default true.
2115            * @param WP_User $user User object for new user.
2116            */
2117           $send_notification_to_admin = apply_filters( 'wp_send_new_user_notification_to_admin', true, $user );
2118
2119           if ( 'user' !== $notify && true === $send_notification_to_admin ) {
2120                $switched_locale = switch_to_locale( get_locale() );
2121
2122                /* translators: %s: Site title. */
2123                $message = sprintf( __( 'New user registration on your site %s:' ), $blogname ) . "\r\n\r\n";
2124                /* translators: %s: User login. */
2125                $message .= sprintf( __( 'Username: %s' ), $user->user_login ) . "\r\n\r\n";
2126                /* translators: %s: User email address. */