Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_send_new_user_notification_to_user

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
2179
2180           /**
2181            * Filters whether the user is notified of their new user registration.
2182            *
2183            * @since 6.1.0
2184            *
2185            * @param bool    $send Whether to send the email. Default true.
2186            * @param WP_User $user User object for new user.
2187            */
2188           $send_notification_to_user = apply_filters( 'wp_send_new_user_notification_to_user', true, $user );
2189
2190           // `$deprecated` was pre-4.3 `$plaintext_pass`. An empty `$plaintext_pass` didn't sent a user notification.
2191           if ( 'admin' === $notify || true !== $send_notification_to_user || ( empty( $deprecated ) && empty( $notify ) ) ) {
2192                return;
2193           }
2194
2195           $key = get_password_reset_key( $user );
2196           if ( is_wp_error( $key ) ) {
2197                return;