WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #761, comment 13


Ignore:
Timestamp:
09/26/12 22:58:04 (19 months ago)
Author:
coffee2code
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #761, comment 13

    initial v1  
    1212The only risk I see for breaking existing compatibility would be if someone was calling `wp_notify_postauthor()` directly and not expecting `get_option('comments_notify')` and comment_approved checks to be performed. They can bypass those using the newly introduced 'wp_notify_postauthor' hook and do a `__return_true`. 
    1313 
    14 Additionally, the patch does change `wp_set_comment_status()` such that the call to `wp_notify_postauthor()` happens after the `$wpdb->update()`. This ensures that the comment is in the approved state prior to `wp_notify_postauthor()` acts on the comment, and also prevents the notification from being triggered if the update fails for some reason. 
     14Additionally, the patch does change `wp_set_comment_status()` such that the call to `wp_notify_postauthor()` happens after the `$wpdb->update()`. This ensures that the comment is in the approved state prior to `wp_notify_postauthor()` acts on the comment, and also prevents the notification from being triggered if the update fails for some reason (prior to this patch, the notification gets sent before the update is attempted). 
    1515 
    1616Tangentially, the `$comment_type` argument to `wp_notify_postauthor()` is superfluous, but I'll open a separate ticket to address that.