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
2234
2235           /**
2236            * Filters whether the user is notified of their new user registration.
2237            *
2238            * @since 6.1.0
2239            *
2240            * @param bool    $send Whether to send the email. Default true.
2241            * @param WP_User $user User object for new user.
2242            */
2243           $send_notification_to_user = apply_filters( 'wp_send_new_user_notification_to_user', true, $user );
2244
2245           // `$deprecated` was pre-4.3 `$plaintext_pass`. An empty `$plaintext_pass` didn't sent a user notification.
2246           if ( 'admin' === $notify || true !== $send_notification_to_user || ( empty( $deprecated ) && empty( $notify ) ) ) {
2247                return;
2248           }
2249
2250           $key = get_password_reset_key( $user );
2251           if ( is_wp_error( $key ) ) {
2252                return;