Ticket #33587: 33587.4.diff
File 33587.4.diff, 9.7 KB (added by , 10 years ago) |
---|
-
wp-admin/includes/user.php
176 176 $user_id = wp_update_user( $user ); 177 177 } else { 178 178 $user_id = wp_insert_user( $user ); 179 wp_new_user_notification( $user_id, 'both' ); 179 /** 180 * Fires after a new user has been created. 181 * 182 * @since 4.4.0 183 * 184 * @param int $user_id ID of the newly created user. 185 * @param string $notify 'both' is passed to the filter for the `wp_new_user_notification()` callback. 186 */ 187 do_action( 'create_user', $user_id, 'both' ); 180 188 } 181 189 return $user_id; 182 190 } -
wp-admin/network/site-new.php
94 94 if ( false === $user_id ) 95 95 wp_die( __( 'There was an error creating the user.' ) ); 96 96 else 97 wp_new_user_notification( $user_id, 'both' ); 97 /** 98 * Fires after a new user has been created. 99 * 100 * @since 4.4.0 101 * 102 * @param int $user_id ID of the newly created user. 103 * @param string $notify 'both' is passed to the filter for the `wp_new_user_notification()` callback. 104 */ 105 do_action( 'create_user', $user_id, 'both' ); 98 106 } 99 107 100 108 $wpdb->hide_errors(); -
wp-admin/network/site-users.php
77 77 if ( false === $user_id ) { 78 78 $update = 'err_new_dup'; 79 79 } else { 80 wp_new_user_notification( $user_id, 'both' );81 80 add_user_to_blog( $id, $user_id, $_POST['new_role'] ); 82 81 $update = 'newuser'; 82 /** 83 * Fires after a new user has been created. 84 * 85 * @since 4.4.0 86 * 87 * @param int $user_id ID of the newly created user. 88 * @param string $notify 'both' is passed to the filter for the `wp_new_user_notification()` callback. 89 */ 90 do_action( 'create_user', $user_id, 'both' ); 83 91 } 84 92 } 85 93 break; -
wp-admin/network/user-new.php
51 51 if ( ! $user_id ) { 52 52 $add_user_errors = new WP_Error( 'add_user_fail', __( 'Cannot add user.' ) ); 53 53 } else { 54 wp_new_user_notification( $user_id, 'both' ); 54 /** 55 * Fires after a new user has been created. 56 * 57 * @since 4.4.0 58 * 59 * @param int $user_id ID of the newly created user. 60 * @param string $notify 'both' is passed to the filter for the `wp_new_user_notification()` callback. 61 */ 62 do_action( 'create_user', $user_id, 'both' ); 55 63 wp_redirect( add_query_arg( array('update' => 'added'), 'user-new.php' ) ); 56 64 exit; 57 65 } -
wp-includes/comment-functions.php
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 /** -
wp-includes/default-filters.php
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 add_action( 'create_user', 'wp_new_user_notification', 10, 2 ); 343 337 344 /** 338 345 * Filters formerly mixed into wp-includes 339 346 */ -
wp-includes/ms-default-filters.php
25 25 add_action( 'init', 'maybe_add_existing_user_to_blog' ); 26 26 add_action( 'wpmu_new_user', 'newuser_notify_siteadmin' ); 27 27 add_action( 'wpmu_activate_user', 'add_new_user_to_blog', 10, 3 ); 28 add_action( 'wpmu_activate_user', 'wpmu_welcome_user_notification', 10, 3 ); 28 29 add_filter( 'sanitize_user', 'strtolower' ); 30 add_action( 'after_signup_user', 'wpmu_signup_user_notification', 10, 4 ); 29 31 30 32 // Blogs 31 33 add_filter( 'wpmu_validate_blog_signup', 'signup_nonce_check' ); 32 34 add_action( 'wpmu_new_blog', 'wpmu_log_new_registrations', 10, 2 ); 33 35 add_action( 'wpmu_new_blog', 'newblog_notify_siteadmin', 10, 2 ); 36 add_action( 'wpmu_activate_blog', 'wpmu_welcome_notification', 10, 5 ); 37 add_action( 'after_signup_blog', 'wpmu_signup_blog_notification', 10, 7 ); 34 38 35 39 // Register Nonce 36 40 add_action( 'signup_hidden_fields', 'signup_nonce_fields' ); -
wp-includes/ms-functions.php
745 745 'meta' => $meta 746 746 ) ); 747 747 748 wpmu_signup_blog_notification($domain, $path, $title, $user, $user_email, $key, $meta); 748 /** 749 * Fires after site signup information has been written to the database 750 * 751 * @since 752 * 753 * @param string $domain The requested domain. 754 * @param string $path The requested path. 755 * @param string $title The requested site title. 756 * @param string $user The user's requested login name. 757 * @param string $user_email The user's email address. 758 * @param string $key The user's activation key 759 * @param array $meta By default, contains the requested privacy setting and lang_id. 760 */ 761 do_action( 'after_signup_blog', $domain, $path, $title, $user, $user_email, $key, $meta ); 749 762 } 750 763 751 764 /** … … 782 795 'meta' => $meta 783 796 ) ); 784 797 785 wpmu_signup_user_notification($user, $user_email, $key, $meta); 798 /** 799 * Fires after a user's signup information has been written to the database 800 * 801 * @since 802 * 803 * @param string $user The user's requested login name. 804 * @param string $user_email The user's email address. 805 * @param string $key The user's activation key 806 * @param array $meta By default, this is an empty array. 807 */ 808 do_action( 'after_signup_user', $user, $user_email, $key, $meta); 786 809 } 787 810 788 811 /** … … 1027 1050 if ( isset( $user_already_exists ) ) 1028 1051 return new WP_Error( 'user_already_exists', __( 'That username is already activated.' ), $signup); 1029 1052 1030 wpmu_welcome_user_notification( $user_id, $password, $meta );1031 1053 /** 1032 1054 * Fires immediately after a new user is activated. 1033 1055 * … … 1055 1077 } 1056 1078 1057 1079 $wpdb->update( $wpdb->signups, array('active' => 1, 'activated' => $now), array('activation_key' => $key) ); 1058 wpmu_welcome_notification($blog_id, $user_id, $password, $signup->title, $meta);1059 1080 /** 1060 1081 * Fires immediately after a site is activated. 1061 1082 * -
wp-includes/user-functions.php
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 /** … … 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 }