wp_set_comment_status

wp_set_comment_status

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7.2

do_action('wp_set_comment_status') is found 2 times:

  • /wp-includes/comment.php line 1527
    1524
    1525
    1526
    1527
    1528
    1529
    1530
    1531
    1532
        clean_comment_cache( $comment->comment_ID );
     
        /** This action is documented in wp-includes/comment.php */
        do_action( 'wp_set_comment_status', $comment->comment_ID, 'delete' );
     
        wp_transition_comment_status( 'delete', $comment->comment_approved, $comment );
     
        return true;
    }
  • /wp-includes/comment.php line 2482
    2478
    2479
    2480
    2481
    2482
    2483
    2484
    2485
    2486
    2487
    2488
    * @param string $comment_id     Comment ID as a numeric string.
     * @param string $comment_status Current comment status. Possible values include
     *                               'hold', '0', 'approve', '1', 'spam', and 'trash'.
     */
    do_action( 'wp_set_comment_status', $comment->comment_ID, $comment_status );
     
    wp_transition_comment_status( $comment_status, $comment_old->comment_approved, $comment );
     
    wp_update_comment_count( $comment->comment_post_ID );
     
    return true;

See this hook used in plugins: