wp-includes/comment.php:2727Sends a single note mention notification email.
$userWP_User$commentWP_Comment$postWP_Post|nullboolfunction wp_send_note_notification( WP_User $user, WP_Comment $comment, ?WP_Post $post ): bool { $switched_locale = switch_to_user_locale( $user->ID ); /* * The site title and the post title are escaped on the way into the database, * and note content is stored as HTML. Both are reversed once here for the * plain text arena of emails. Decoding a second time would go too far and * resolve entities the author meant to be read literally. */ $blogname = wp_specialchars_decode( get_bloginfo( 'name', 'display' ), ENT_QUOTES ); $post_title = $post ? wp_specialchars_decode( get_the_title( $post ), ENT_QUOTES ) : ''; $author_name = $comment->comment_author ? $comment->comment_author : __( 'Someone' ); $content = wp_specialchars_decode( wp_strip_all_tags( $comment->comment_content ) ); /* * The rest of the message is composed for the recipient, and so is the editor * link: get_edit_post_link() answers for whoever is current, which here is the * note's author over REST and nobody at all under WP-Cron. */ $edit_link = ''; if ( $post ) { $previous_user_id = get_current_user_id(); wp_set_current_user( $user->ID ); $edit_link = (string) get_edit_post_link( $post->ID, 'url' ); wp_set_current_user( $previous_user_id ); } /* translators: 1: Note author's name, 2: Post title. */ $message = sprintf( __( '%1$s mentioned you in a note on "%2$s".' ), $author_name, $post_title ); /* translators: Note mention notification email subject. 1: Site title, 2: Post title. */ $subject = sprintf( __( '[%1$s] You were mentioned in a note on "%2$s"' ), $blogname, $post_title ); $lines = array( $message, '' ); if ( '' !== $content ) { $lines[] = $content; } if ( $edit_link ) { $lines[] = ''; $lines[] = __( 'Edit This' ) . ': ' . $edit_link; } // Declared explicitly so a filtered default cannot turn the message into HTML. $headers = 'Content-Type: text/plain; charset="' . get_option( 'blog_charset' ) . '"'; $sent = wp_mail( $user->user_email, $subject, implode( "\n", $lines ), $headers ); if ( $switched_locale ) { restore_previous_locale(); } return $sent;}Introduced in 7.1.0.
Signature, return type and hooks compared across 1 parsed release.
src/wp-includes/comment.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.