WordPress.org

Make WordPress Core

Ticket #41228: 41228.3.diff

File 41228.3.diff, 5.3 KB (added by henry.wright, 2 years ago)

Thanks for the link to the coding standards. I'll note what constitutes a significant change for next time. 41228.3.diff adds @since tags to each DocBlock.

  • src/wp-includes/comment.php

    diff --git src/wp-includes/comment.php src/wp-includes/comment.php
    index 7055db7..ce347dd 100644
    function wp_delete_comment($comment_id, $force_delete = false) { 
    12851285         * Fires immediately before a comment is deleted from the database.
    12861286         *
    12871287         * @since 1.2.0
     1288         * @since 4.9.0 Added the `$comment` argument.
    12881289         *
    12891290         * @param int $comment_id The comment ID.
     1291         * @param WP_Comment $comment The comment to be deleted.
    12901292         */
    1291         do_action( 'delete_comment', $comment->comment_ID );
     1293        do_action( 'delete_comment', $comment->comment_ID, $comment );
    12921294
    12931295        // Move children up a level.
    12941296        $children = $wpdb->get_col( $wpdb->prepare("SELECT comment_ID FROM $wpdb->comments WHERE comment_parent = %d", $comment->comment_ID) );
    function wp_delete_comment($comment_id, $force_delete = false) { 
    13091311         * Fires immediately after a comment is deleted from the database.
    13101312         *
    13111313         * @since 2.9.0
     1314         * @since 4.9.0 Added the `$comment` argument.
    13121315         *
    13131316         * @param int $comment_id The comment ID.
     1317         * @param WP_Comment $comment The deleted comment.
    13141318         */
    1315         do_action( 'deleted_comment', $comment->comment_ID );
     1319        do_action( 'deleted_comment', $comment->comment_ID, $comment );
    13161320
    13171321        $post_id = $comment->comment_post_ID;
    13181322        if ( $post_id && $comment->comment_approved == 1 )
    function wp_trash_comment($comment_id) { 
    13481352         * Fires immediately before a comment is sent to the Trash.
    13491353         *
    13501354         * @since 2.9.0
     1355         * @since 4.9.0 Added the `$comment` argument.
    13511356         *
    13521357         * @param int $comment_id The comment ID.
     1358         * @param WP_Comment $comment The comment to be trashed.
    13531359         */
    1354         do_action( 'trash_comment', $comment->comment_ID );
     1360        do_action( 'trash_comment', $comment->comment_ID, $comment );
    13551361
    13561362        if ( wp_set_comment_status( $comment, 'trash' ) ) {
    13571363                delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_status' );
    function wp_trash_comment($comment_id) { 
    13631369                 * Fires immediately after a comment is sent to Trash.
    13641370                 *
    13651371                 * @since 2.9.0
     1372                 * @since 4.9.0 Added the `$comment` argument.
    13661373                 *
    13671374                 * @param int $comment_id The comment ID.
     1375                 * @param WP_Comment $comment The trashed comment.
    13681376                 */
    1369                 do_action( 'trashed_comment', $comment->comment_ID );
     1377                do_action( 'trashed_comment', $comment->comment_ID, $comment );
    13701378                return true;
    13711379        }
    13721380
    function wp_untrash_comment($comment_id) { 
    13911399         * Fires immediately before a comment is restored from the Trash.
    13921400         *
    13931401         * @since 2.9.0
     1402         * @since 4.9.0 Added the `$comment` argument.
    13941403         *
    13951404         * @param int $comment_id The comment ID.
     1405         * @param WP_Comment $comment The comment to be untrashed.
    13961406         */
    1397         do_action( 'untrash_comment', $comment->comment_ID );
     1407        do_action( 'untrash_comment', $comment->comment_ID, $comment );
    13981408
    13991409        $status = (string) get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true );
    14001410        if ( empty($status) )
    function wp_untrash_comment($comment_id) { 
    14071417                 * Fires immediately after a comment is restored from the Trash.
    14081418                 *
    14091419                 * @since 2.9.0
     1420                 * @since 4.9.0 Added the `$comment` argument.
    14101421                 *
    14111422                 * @param int $comment_id The comment ID.
     1423                 * @param WP_Comment $comment The untrashed comment.
    14121424                 */
    1413                 do_action( 'untrashed_comment', $comment->comment_ID );
     1425                do_action( 'untrashed_comment', $comment->comment_ID, $comment );
    14141426                return true;
    14151427        }
    14161428
    function wp_spam_comment( $comment_id ) { 
    14351447         * Fires immediately before a comment is marked as Spam.
    14361448         *
    14371449         * @since 2.9.0
     1450         * @since 4.9.0 Added the `$comment` argument.
    14381451         *
    14391452         * @param int $comment_id The comment ID.
     1453         * @param WP_Comment $comment The comment to be marked as spam.
    14401454         */
    1441         do_action( 'spam_comment', $comment->comment_ID );
     1455        do_action( 'spam_comment', $comment->comment_ID, $comment );
    14421456
    14431457        if ( wp_set_comment_status( $comment, 'spam' ) ) {
    14441458                delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_status' );
    function wp_spam_comment( $comment_id ) { 
    14491463                 * Fires immediately after a comment is marked as Spam.
    14501464                 *
    14511465                 * @since 2.9.0
     1466                 * @since 4.9.0 Added the `$comment` argument.
    14521467                 *
    14531468                 * @param int $comment_id The comment ID.
     1469                 * @param WP_Comment $comment The comment marked as spam.
    14541470                 */
    1455                 do_action( 'spammed_comment', $comment->comment_ID );
     1471                do_action( 'spammed_comment', $comment->comment_ID, $comment );
    14561472                return true;
    14571473        }
    14581474
    function wp_unspam_comment( $comment_id ) { 
    14771493         * Fires immediately before a comment is unmarked as Spam.
    14781494         *
    14791495         * @since 2.9.0
     1496         * @since 4.9.0 Added the `$comment` argument.
    14801497         *
    14811498         * @param int $comment_id The comment ID.
     1499         * @param WP_Comment $comment The comment to be unmarked as spam.
    14821500         */
    1483         do_action( 'unspam_comment', $comment->comment_ID );
     1501        do_action( 'unspam_comment', $comment->comment_ID, $comment );
    14841502
    14851503        $status = (string) get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true );
    14861504        if ( empty($status) )
    function wp_unspam_comment( $comment_id ) { 
    14931511                 * Fires immediately after a comment is unmarked as Spam.
    14941512                 *
    14951513                 * @since 2.9.0
     1514                 * @since 4.9.0 Added the `$comment` argument.
    14961515                 *
    14971516                 * @param int $comment_id The comment ID.
     1517                 * @param WP_Comment $comment The comment unmarked as spam.
    14981518                 */
    1499                 do_action( 'unspammed_comment', $comment->comment_ID );
     1519                do_action( 'unspammed_comment', $comment->comment_ID, $comment );
    15001520                return true;
    15011521        }
    15021522