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
2201
2202           /**
2203            * Filters whether the user is notified of their new user registration.
2204            *
2205            * @since 6.1.0
2206            *
2207            * @param bool    $send Whether to send the email. Default true.
2208            * @param WP_User $user User object for new user.
2209            */
2210           $send_notification_to_user = apply_filters( 'wp_send_new_user_notification_to_user', true, $user );
2211
2212           // `$deprecated` was pre-4.3 `$plaintext_pass`. An empty `$plaintext_pass` didn't sent a user notification.
2213           if ( 'admin' === $notify || true !== $send_notification_to_user || ( empty( $deprecated ) && empty( $notify ) ) ) {
2214                return;
2215           }
2216
2217           $key = get_password_reset_key( $user );
2218           if ( is_wp_error( $key ) ) {
2219                return;