diff --git src/wp-includes/comment-functions.php src/wp-includes/comment-functions.php
index f953a9e..76a7a16 100644
|
|
function wp_new_comment( $commentdata ) { |
1629 | 1629 | */ |
1630 | 1630 | do_action( 'comment_post', $comment_ID, $commentdata['comment_approved'] ); |
1631 | 1631 | |
1632 | | if ( 'spam' !== $commentdata['comment_approved'] ) { // If it's spam save it silently for later crunching |
1633 | | if ( '0' == $commentdata['comment_approved'] ) { |
1634 | | wp_notify_moderator( $comment_ID ); |
1635 | | } |
| 1632 | return $comment_ID; |
| 1633 | } |
1636 | 1634 | |
1637 | | // wp_notify_postauthor() checks if notifying the author of their own comment. |
1638 | | // By default, it won't, but filters can override this. |
1639 | | if ( get_option( 'comments_notify' ) && $commentdata['comment_approved'] ) { |
1640 | | wp_notify_postauthor( $comment_ID ); |
1641 | | } |
| 1635 | /** |
| 1636 | * Initiate a comment moderation notification for the comment moderator. |
| 1637 | * |
| 1638 | * @since 4.4.0 |
| 1639 | * |
| 1640 | * @param int $comment_ID ID of the comment. |
| 1641 | * @param int $comment_approved Whether the comment is approved. |
| 1642 | */ |
| 1643 | function wp_new_comment_moderator_notification( $comment_ID, $comment_approved ) { |
| 1644 | if ( '0' == $comment_approved ) { |
| 1645 | wp_notify_moderator( $comment_ID ); |
1642 | 1646 | } |
| 1647 | } |
1643 | 1648 | |
1644 | | return $comment_ID; |
| 1649 | /** |
| 1650 | * Initiate a new comment notification for the post author. |
| 1651 | * |
| 1652 | * @since 4.4.0 |
| 1653 | * |
| 1654 | * @param int $comment_ID ID of the comment. |
| 1655 | */ |
| 1656 | function wp_new_comment_postauthor_notification( $comment_ID ) { |
| 1657 | // wp_notify_postauthor() checks if notifying the author of their own comment. |
| 1658 | // By default, it won't, but filters can override this. |
| 1659 | if ( get_option( 'comments_notify' ) && $commentdata['comment_approved'] ) { |
| 1660 | wp_notify_postauthor( $comment_ID ); |
| 1661 | } |
1645 | 1662 | } |
1646 | 1663 | |
1647 | 1664 | /** |
diff --git src/wp-includes/default-filters.php src/wp-includes/default-filters.php
index b6f0ce3..095e8e1 100644
|
|
add_action( 'split_shared_term', '_wp_check_split_terms_in_menus', 10, 4 ); |
334 | 334 | add_action( 'split_shared_term', '_wp_check_split_nav_menu_terms', 10, 4 ); |
335 | 335 | add_action( 'wp_split_shared_term_batch', '_wp_batch_split_terms' ); |
336 | 336 | |
| 337 | // Email notifications. |
| 338 | add_action( 'comment_post', 'wp_new_comment_notify_moderator', 10, 2 ); |
| 339 | add_action( 'comment_post', 'wp_new_comment_notify_postauthor', 10 ); |
| 340 | add_action( 'after_password_reset', 'wp_password_change_notification' ); |
| 341 | add_action( 'register_new_user', 'wp_new_user_notification', 10, 2 ); |
| 342 | |
337 | 343 | /** |
338 | 344 | * Filters formerly mixed into wp-includes |
339 | 345 | */ |
diff --git src/wp-includes/user-functions.php src/wp-includes/user-functions.php
index 762e54e..ab405e5 100644
|
|
function reset_password( $user, $new_pass ) { |
1916 | 1916 | wp_set_password( $new_pass, $user->ID ); |
1917 | 1917 | update_user_option( $user->ID, 'default_password_nag', false, true ); |
1918 | 1918 | |
1919 | | wp_password_change_notification( $user ); |
| 1919 | /** |
| 1920 | * Fires after the user's password is reset. |
| 1921 | * |
| 1922 | * @since 4.4.0 |
| 1923 | * |
| 1924 | * @param object $user The user. |
| 1925 | * @param string $new_pass New user password. |
| 1926 | */ |
| 1927 | do_action( 'after_password_reset', $user, $new_pass ); |
1920 | 1928 | } |
1921 | 1929 | |
1922 | 1930 | /** |
… |
… |
function register_new_user( $user_login, $user_email ) { |
2004 | 2012 | |
2005 | 2013 | update_user_option( $user_id, 'default_password_nag', true, true ); //Set up the Password change nag. |
2006 | 2014 | |
2007 | | wp_new_user_notification( $user_id, 'both' ); |
| 2015 | /** |
| 2016 | * Fires after a new user registration has been recorded. |
| 2017 | * |
| 2018 | * @since 4.4.0 |
| 2019 | * |
| 2020 | * @param int $user_id ID of the newly registered user. |
| 2021 | * @param string $notify 'both' is passed to the filter for the `wp_new_user_notification()` callback. |
| 2022 | */ |
| 2023 | do_action( 'register_new_user', $user_id, 'both' ); |
2008 | 2024 | |
2009 | 2025 | return $user_id; |
2010 | 2026 | } |