Make WordPress Core


Ignore:
Timestamp:
09/16/2015 10:25:07 PM (9 years ago)
Author:
boonebgorges
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment-functions.php

    r34250 r34252  
    16471647 * @since 4.4.0
    16481648 *
    1649  * @param int $comment_ID       ID of the comment.
    1650  * @param int $comment_approved Whether the comment is approved.
     1649 * @param int $comment_ID ID of the comment.
    16511650 * @return bool True on success, false on failure.
    16521651 */
    1653 function wp_new_comment_notify_moderator( $comment_ID, $comment_approved ) {
     1652function wp_new_comment_notify_moderator( $comment_ID ) {
     1653    $comment = get_comment( $comment_ID );
     1654
    16541655    // Only send notifications for pending comments.
    1655     if ( '0' != $comment_approved ) {
     1656    if ( '0' != $comment->comment_approved ) {
    16561657        return false;
    16571658    }
Note: See TracChangeset for help on using the changeset viewer.