Make WordPress Core

Changeset 26358


Ignore:
Timestamp:
11/24/2013 04:25:44 PM (11 years ago)
Author:
westi
Message:

Deprecate the second argument for wp_notify_postauthor because it is unecessary. Fixes #17862 props scribu and wonderboymusic.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

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

    r26081 r26358  
    14151415
    14161416    if ( 'spam' !== $commentdata['comment_approved'] ) { // If it's spam save it silently for later crunching
    1417         if ( '0' == $commentdata['comment_approved'] )
    1418             wp_notify_moderator($comment_ID);
    1419 
    1420         $post = get_post($commentdata['comment_post_ID']); // Don't notify if it's your own comment
    1421 
    1422         if ( get_option('comments_notify') && $commentdata['comment_approved'] && ( ! isset( $commentdata['user_id'] ) || $post->post_author != $commentdata['user_id'] ) )
    1423             wp_notify_postauthor($comment_ID, isset( $commentdata['comment_type'] ) ? $commentdata['comment_type'] : '' );
     1417        if ( '0' == $commentdata['comment_approved'] ) {
     1418            wp_notify_moderator( $comment_ID );
     1419        }
     1420
     1421        if ( get_option('comments_notify') && $commentdata['comment_approved'] ) {
     1422            $post = get_post( $commentdata['comment_post_ID'] );
     1423            // Don't notify if it's your own comment
     1424            if ( ! isset( $commentdata['user_id'] ) || $post->post_author != $commentdata['user_id'] ) {
     1425                wp_notify_postauthor( $comment_ID );
     1426            }
     1427        }
    14241428    }
    14251429
     
    14541458            $status = '1';
    14551459            if ( get_option('comments_notify') ) {
    1456                 $comment = get_comment($comment_id);
    1457                 wp_notify_postauthor($comment_id, $comment->comment_type);
     1460                wp_notify_postauthor( $comment_id );
    14581461            }
    14591462            break;
  • trunk/src/wp-includes/pluggable.php

    r26121 r26358  
    10061006 *
    10071007 * @param int $comment_id Comment ID
    1008  * @param string $comment_type Optional. The comment type either 'comment' (default), 'trackback', or 'pingback'
     1008 * @param string $deprecated Not used
    10091009 * @return bool False if user email does not exist. True on completion.
    10101010 */
    1011 function wp_notify_postauthor( $comment_id, $comment_type = '' ) {
     1011function wp_notify_postauthor( $comment_id, $deprecated = null ) {
     1012    if ( null !== $deprecated ) {
     1013        _deprecated_argument( __FUNCTION__, '3.8' );
     1014    }
     1015
    10121016    $comment = get_comment( $comment_id );
    10131017    if ( empty( $comment ) )
     
    10391043    $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
    10401044
    1041     if ( empty( $comment_type ) ) $comment_type = 'comment';
     1045    $comment_type = $comment->comment_type ? $comment->comment_type : 'comment';
    10421046
    10431047    switch ( $comment_type ) {
Note: See TracChangeset for help on using the changeset viewer.