Improve consistency of comment notification callback signatures.

Both `wp_new_comment_notify_moderator()` and `wp_new_comment_notify_postauthor()`
now accept a single argument: `$comment_ID`.

Props SergeyBiryukov.
Fixes #33587.
Built from https://develop.svn.wordpress.org/trunk@34252


git-svn-id: http://core.svn.wordpress.org/trunk@34216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Boone Gorges 2015-09-16 22:26:24 +00:00
parent 85c00bd943
commit 48b7547a52
3 changed files with 7 additions and 6 deletions

View File

@ -1647,12 +1647,13 @@ function wp_new_comment( $commentdata ) {
* @since 4.4.0 * @since 4.4.0
* *
* @param int $comment_ID ID of the comment. * @param int $comment_ID ID of the comment.
* @param int $comment_approved Whether the comment is approved.
* @return bool True on success, false on failure. * @return bool True on success, false on failure.
*/ */
function wp_new_comment_notify_moderator( $comment_ID, $comment_approved ) { function wp_new_comment_notify_moderator( $comment_ID ) {
$comment = get_comment( $comment_ID );
// Only send notifications for pending comments. // Only send notifications for pending comments.
if ( '0' != $comment_approved ) { if ( '0' != $comment->comment_approved ) {
return false; return false;
} }

View File

@ -336,7 +336,7 @@ add_action( 'split_shared_term', '_wp_check_split_nav_menu_terms', 10, 4 );
add_action( 'wp_split_shared_term_batch', '_wp_batch_split_terms' ); add_action( 'wp_split_shared_term_batch', '_wp_batch_split_terms' );
// Email notifications. // Email notifications.
add_action( 'comment_post', 'wp_new_comment_notify_moderator', 10, 2 ); add_action( 'comment_post', 'wp_new_comment_notify_moderator' );
add_action( 'comment_post', 'wp_new_comment_notify_postauthor' ); add_action( 'comment_post', 'wp_new_comment_notify_postauthor' );
add_action( 'after_password_reset', 'wp_password_change_notification' ); add_action( 'after_password_reset', 'wp_password_change_notification' );
add_action( 'register_new_user', 'wp_send_new_user_notifications' ); add_action( 'register_new_user', 'wp_send_new_user_notifications' );

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.4-alpha-34251'; $wp_version = '4.4-alpha-34252';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.