wp_transition_comment_status

The timeline below displays how wordpress function wp_transition_comment_status has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.2

/**
 * Calls hooks for when a comment status transition occurs.
 *
 * Calls hooks for comment status transitions. If the new comment status is not the same
 * as the previous comment status, then two hooks will be ran, the first is
 * {@see 'transition_comment_status'} with new status, old status, and comment data.
 * The next action called is {@see 'comment_$old_status_to_$new_status'}. It has
 * the comment data.
 *
 * The final action will run whether or not the comment statuses are the same.
 * The action is named {@see 'comment_$new_status_$comment->comment_type'}.
 *
 * @since 2.7.0
 *
 * @param string     $new_status New comment status.
 * @param string     $old_status Previous comment status.
 * @param WP_Comment $comment    Comment object.
 */
function wp_transition_comment_status($new_status, $old_status, $comment)
{
    /*
     * Translate raw statuses to human-readable formats for the hooks.
     * This is not a complete list of comment status, it's only the ones
     * that need to be renamed.
     */
    $comment_statuses = array(
        0 => 'unapproved',
        'hold' => 'unapproved',
        // wp_set_comment_status() uses "hold".
        1 => 'approved',
        'approve' => 'approved',
    );
    if (isset($comment_statuses[$new_status])) {
        $new_status = $comment_statuses[$new_status];
    }
    if (isset($comment_statuses[$old_status])) {
        $old_status = $comment_statuses[$old_status];
    }
    // Call the hooks.
    if ($new_status != $old_status) {
        /**
         * Fires when the comment status is in transition.
         *
         * @since 2.7.0
         *
         * @param int|string $new_status The new comment status.
         * @param int|string $old_status The old comment status.
         * @param WP_Comment $comment    Comment object.
         */
        do_action('transition_comment_status', $new_status, $old_status, $comment);
        /**
         * Fires when the comment status is in transition from one specific status to another.
         *
         * The dynamic portions of the hook name, `$old_status`, and `$new_status`,
         * refer to the old and new comment statuses, respectively.
         *
         * Possible hook names include:
         *
         *  - `comment_unapproved_to_approved`
         *  - `comment_spam_to_approved`
         *  - `comment_approved_to_unapproved`
         *  - `comment_spam_to_unapproved`
         *  - `comment_unapproved_to_spam`
         *  - `comment_approved_to_spam`
         *
         * @since 2.7.0
         *
         * @param WP_Comment $comment Comment object.
         */
        do_action("comment_{$old_status}_to_{$new_status}", $comment);
    }
    /**
     * Fires when the status of a specific comment type is in transition.
     *
     * The dynamic portions of the hook name, `$new_status`, and `$comment->comment_type`,
     * refer to the new comment status, and the type of comment, respectively.
     *
     * Typical comment types include 'comment', 'pingback', or 'trackback'.
     *
     * Possible hook names include:
     *
     *  - `comment_approved_comment`
     *  - `comment_approved_pingback`
     *  - `comment_approved_trackback`
     *  - `comment_unapproved_comment`
     *  - `comment_unapproved_pingback`
     *  - `comment_unapproved_trackback`
     *  - `comment_spam_comment`
     *  - `comment_spam_pingback`
     *  - `comment_spam_trackback`
     *
     * @since 2.7.0
     *
     * @param string     $comment_id The comment ID as a numeric string.
     * @param WP_Comment $comment    Comment object.
     */
    do_action("comment_{$new_status}_{$comment->comment_type}", $comment->comment_ID, $comment);
}

WordPress Version: 6.1

/**
 * Calls hooks for when a comment status transition occurs.
 *
 * Calls hooks for comment status transitions. If the new comment status is not the same
 * as the previous comment status, then two hooks will be ran, the first is
 * {@see 'transition_comment_status'} with new status, old status, and comment data.
 * The next action called is {@see 'comment_$old_status_to_$new_status'}. It has
 * the comment data.
 *
 * The final action will run whether or not the comment statuses are the same.
 * The action is named {@see 'comment_$new_status_$comment->comment_type'}.
 *
 * @since 2.7.0
 *
 * @param string     $new_status New comment status.
 * @param string     $old_status Previous comment status.
 * @param WP_Comment $comment    Comment object.
 */
function wp_transition_comment_status($new_status, $old_status, $comment)
{
    /*
     * Translate raw statuses to human-readable formats for the hooks.
     * This is not a complete list of comment status, it's only the ones
     * that need to be renamed.
     */
    $comment_statuses = array(
        0 => 'unapproved',
        'hold' => 'unapproved',
        // wp_set_comment_status() uses "hold".
        1 => 'approved',
        'approve' => 'approved',
    );
    if (isset($comment_statuses[$new_status])) {
        $new_status = $comment_statuses[$new_status];
    }
    if (isset($comment_statuses[$old_status])) {
        $old_status = $comment_statuses[$old_status];
    }
    // Call the hooks.
    if ($new_status != $old_status) {
        /**
         * Fires when the comment status is in transition.
         *
         * @since 2.7.0
         *
         * @param int|string $new_status The new comment status.
         * @param int|string $old_status The old comment status.
         * @param WP_Comment $comment    Comment object.
         */
        do_action('transition_comment_status', $new_status, $old_status, $comment);
        /**
         * Fires when the comment status is in transition from one specific status to another.
         *
         * The dynamic portions of the hook name, `$old_status`, and `$new_status`,
         * refer to the old and new comment statuses, respectively.
         *
         * Possible hook names include:
         *
         *  - `comment_unapproved_to_approved`
         *  - `comment_spam_to_approved`
         *  - `comment_approved_to_unapproved`
         *  - `comment_spam_to_unapproved`
         *  - `comment_unapproved_to_spam`
         *  - `comment_approved_to_spam`
         *
         * @since 2.7.0
         *
         * @param WP_Comment $comment Comment object.
         */
        do_action("comment_{$old_status}_to_{$new_status}", $comment);
    }
    /**
     * Fires when the status of a specific comment type is in transition.
     *
     * The dynamic portions of the hook name, `$new_status`, and `$comment->comment_type`,
     * refer to the new comment status, and the type of comment, respectively.
     *
     * Typical comment types include 'comment', 'pingback', or 'trackback'.
     *
     * Possible hook names include:
     *
     *  - `comment_approved_comment`
     *  - `comment_approved_pingback`
     *  - `comment_approved_trackback`
     *  - `comment_unapproved_comment`
     *  - `comment_unapproved_pingback`
     *  - `comment_unapproved_trackback`
     *  - `comment_spam_comment`
     *  - `comment_spam_pingback`
     *  - `comment_spam_trackback`
     *
     * @since 2.7.0
     *
     * @param string     $comment_ID The comment ID as a numeric string.
     * @param WP_Comment $comment    Comment object.
     */
    do_action("comment_{$new_status}_{$comment->comment_type}", $comment->comment_ID, $comment);
}

WordPress Version: 5.9

/**
 * Call hooks for when a comment status transition occurs.
 *
 * Calls hooks for comment status transitions. If the new comment status is not the same
 * as the previous comment status, then two hooks will be ran, the first is
 * {@see 'transition_comment_status'} with new status, old status, and comment data.
 * The next action called is {@see 'comment_$old_status_to_$new_status'}. It has
 * the comment data.
 *
 * The final action will run whether or not the comment statuses are the same.
 * The action is named {@see 'comment_$new_status_$comment->comment_type'}.
 *
 * @since 2.7.0
 *
 * @param string     $new_status New comment status.
 * @param string     $old_status Previous comment status.
 * @param WP_Comment $comment    Comment object.
 */
function wp_transition_comment_status($new_status, $old_status, $comment)
{
    /*
     * Translate raw statuses to human-readable formats for the hooks.
     * This is not a complete list of comment status, it's only the ones
     * that need to be renamed.
     */
    $comment_statuses = array(
        0 => 'unapproved',
        'hold' => 'unapproved',
        // wp_set_comment_status() uses "hold".
        1 => 'approved',
        'approve' => 'approved',
    );
    if (isset($comment_statuses[$new_status])) {
        $new_status = $comment_statuses[$new_status];
    }
    if (isset($comment_statuses[$old_status])) {
        $old_status = $comment_statuses[$old_status];
    }
    // Call the hooks.
    if ($new_status != $old_status) {
        /**
         * Fires when the comment status is in transition.
         *
         * @since 2.7.0
         *
         * @param int|string $new_status The new comment status.
         * @param int|string $old_status The old comment status.
         * @param WP_Comment $comment    Comment object.
         */
        do_action('transition_comment_status', $new_status, $old_status, $comment);
        /**
         * Fires when the comment status is in transition from one specific status to another.
         *
         * The dynamic portions of the hook name, `$old_status`, and `$new_status`,
         * refer to the old and new comment statuses, respectively.
         *
         * Possible hook names include:
         *
         *  - `comment_unapproved_to_approved`
         *  - `comment_spam_to_approved`
         *  - `comment_approved_to_unapproved`
         *  - `comment_spam_to_unapproved`
         *  - `comment_unapproved_to_spam`
         *  - `comment_approved_to_spam`
         *
         * @since 2.7.0
         *
         * @param WP_Comment $comment Comment object.
         */
        do_action("comment_{$old_status}_to_{$new_status}", $comment);
    }
    /**
     * Fires when the status of a specific comment type is in transition.
     *
     * The dynamic portions of the hook name, `$new_status`, and `$comment->comment_type`,
     * refer to the new comment status, and the type of comment, respectively.
     *
     * Typical comment types include 'comment', 'pingback', or 'trackback'.
     *
     * Possible hook names include:
     *
     *  - `comment_approved_comment`
     *  - `comment_approved_pingback`
     *  - `comment_approved_trackback`
     *  - `comment_unapproved_comment`
     *  - `comment_unapproved_pingback`
     *  - `comment_unapproved_trackback`
     *  - `comment_spam_comment`
     *  - `comment_spam_pingback`
     *  - `comment_spam_trackback`
     *
     * @since 2.7.0
     *
     * @param string     $comment_ID The comment ID as a numeric string.
     * @param WP_Comment $comment    Comment object.
     */
    do_action("comment_{$new_status}_{$comment->comment_type}", $comment->comment_ID, $comment);
}

WordPress Version: 5.4

/**
 * Call hooks for when a comment status transition occurs.
 *
 * Calls hooks for comment status transitions. If the new comment status is not the same
 * as the previous comment status, then two hooks will be ran, the first is
 * {@see 'transition_comment_status'} with new status, old status, and comment data.
 * The next action called is {@see 'comment_$old_status_to_$new_status'}. It has
 * the comment data.
 *
 * The final action will run whether or not the comment statuses are the same.
 * The action is named {@see 'comment_$new_status_$comment->comment_type'}.
 *
 * @since 2.7.0
 *
 * @param string     $new_status New comment status.
 * @param string     $old_status Previous comment status.
 * @param WP_Comment $comment    Comment object.
 */
function wp_transition_comment_status($new_status, $old_status, $comment)
{
    /*
     * Translate raw statuses to human-readable formats for the hooks.
     * This is not a complete list of comment status, it's only the ones
     * that need to be renamed.
     */
    $comment_statuses = array(
        0 => 'unapproved',
        'hold' => 'unapproved',
        // wp_set_comment_status() uses "hold".
        1 => 'approved',
        'approve' => 'approved',
    );
    if (isset($comment_statuses[$new_status])) {
        $new_status = $comment_statuses[$new_status];
    }
    if (isset($comment_statuses[$old_status])) {
        $old_status = $comment_statuses[$old_status];
    }
    // Call the hooks.
    if ($new_status != $old_status) {
        /**
         * Fires when the comment status is in transition.
         *
         * @since 2.7.0
         *
         * @param int|string $new_status The new comment status.
         * @param int|string $old_status The old comment status.
         * @param WP_Comment $comment    Comment object.
         */
        do_action('transition_comment_status', $new_status, $old_status, $comment);
        /**
         * Fires when the comment status is in transition from one specific status to another.
         *
         * The dynamic portions of the hook name, `$old_status`, and `$new_status`,
         * refer to the old and new comment statuses, respectively.
         *
         * @since 2.7.0
         *
         * @param WP_Comment $comment Comment object.
         */
        do_action("comment_{$old_status}_to_{$new_status}", $comment);
    }
    /**
     * Fires when the status of a specific comment type is in transition.
     *
     * The dynamic portions of the hook name, `$new_status`, and `$comment->comment_type`,
     * refer to the new comment status, and the type of comment, respectively.
     *
     * Typical comment types include an empty string (standard comment), 'pingback',
     * or 'trackback'.
     *
     * @since 2.7.0
     *
     * @param int        $comment_ID The comment ID.
     * @param WP_Comment $comment    Comment object.
     */
    do_action("comment_{$new_status}_{$comment->comment_type}", $comment->comment_ID, $comment);
}

WordPress Version: 4.6

/**
 * Call hooks for when a comment status transition occurs.
 *
 * Calls hooks for comment status transitions. If the new comment status is not the same
 * as the previous comment status, then two hooks will be ran, the first is
 * {@see 'transition_comment_status'} with new status, old status, and comment data. The
 * next action called is {@see comment_$old_status_to_$new_status'}. It has the
 * comment data.
 *
 * The final action will run whether or not the comment statuses are the same. The
 * action is named {@see 'comment_$new_status_$comment->comment_type'}.
 *
 * @since 2.7.0
 *
 * @param string $new_status New comment status.
 * @param string $old_status Previous comment status.
 * @param object $comment Comment data.
 */
function wp_transition_comment_status($new_status, $old_status, $comment)
{
    /*
     * Translate raw statuses to human readable formats for the hooks.
     * This is not a complete list of comment status, it's only the ones
     * that need to be renamed
     */
    $comment_statuses = array(
        0 => 'unapproved',
        'hold' => 'unapproved',
        // wp_set_comment_status() uses "hold"
        1 => 'approved',
        'approve' => 'approved',
    );
    if (isset($comment_statuses[$new_status])) {
        $new_status = $comment_statuses[$new_status];
    }
    if (isset($comment_statuses[$old_status])) {
        $old_status = $comment_statuses[$old_status];
    }
    // Call the hooks
    if ($new_status != $old_status) {
        /**
         * Fires when the comment status is in transition.
         *
         * @since 2.7.0
         *
         * @param int|string $new_status The new comment status.
         * @param int|string $old_status The old comment status.
         * @param object     $comment    The comment data.
         */
        do_action('transition_comment_status', $new_status, $old_status, $comment);
        /**
         * Fires when the comment status is in transition from one specific status to another.
         *
         * The dynamic portions of the hook name, `$old_status`, and `$new_status`,
         * refer to the old and new comment statuses, respectively.
         *
         * @since 2.7.0
         *
         * @param WP_Comment $comment Comment object.
         */
        do_action("comment_{$old_status}_to_{$new_status}", $comment);
    }
    /**
     * Fires when the status of a specific comment type is in transition.
     *
     * The dynamic portions of the hook name, `$new_status`, and `$comment->comment_type`,
     * refer to the new comment status, and the type of comment, respectively.
     *
     * Typical comment types include an empty string (standard comment), 'pingback',
     * or 'trackback'.
     *
     * @since 2.7.0
     *
     * @param int        $comment_ID The comment ID.
     * @param WP_Comment $comment    Comment object.
     */
    do_action("comment_{$new_status}_{$comment->comment_type}", $comment->comment_ID, $comment);
}

WordPress Version: 4.4

/**
 * Call hooks for when a comment status transition occurs.
 *
 * Calls hooks for comment status transitions. If the new comment status is not the same
 * as the previous comment status, then two hooks will be ran, the first is
 * 'transition_comment_status' with new status, old status, and comment data. The
 * next action called is 'comment_OLDSTATUS_to_NEWSTATUS' the NEWSTATUS is the
 * $new_status parameter and the OLDSTATUS is $old_status parameter; it has the
 * comment data.
 *
 * The final action will run whether or not the comment statuses are the same. The
 * action is named 'comment_NEWSTATUS_COMMENTTYPE', NEWSTATUS is from the $new_status
 * parameter and COMMENTTYPE is comment_type comment data.
 *
 * @since 2.7.0
 *
 * @param string $new_status New comment status.
 * @param string $old_status Previous comment status.
 * @param object $comment Comment data.
 */
function wp_transition_comment_status($new_status, $old_status, $comment)
{
    /*
     * Translate raw statuses to human readable formats for the hooks.
     * This is not a complete list of comment status, it's only the ones
     * that need to be renamed
     */
    $comment_statuses = array(
        0 => 'unapproved',
        'hold' => 'unapproved',
        // wp_set_comment_status() uses "hold"
        1 => 'approved',
        'approve' => 'approved',
    );
    if (isset($comment_statuses[$new_status])) {
        $new_status = $comment_statuses[$new_status];
    }
    if (isset($comment_statuses[$old_status])) {
        $old_status = $comment_statuses[$old_status];
    }
    // Call the hooks
    if ($new_status != $old_status) {
        /**
         * Fires when the comment status is in transition.
         *
         * @since 2.7.0
         *
         * @param int|string $new_status The new comment status.
         * @param int|string $old_status The old comment status.
         * @param object     $comment    The comment data.
         */
        do_action('transition_comment_status', $new_status, $old_status, $comment);
        /**
         * Fires when the comment status is in transition from one specific status to another.
         *
         * The dynamic portions of the hook name, `$old_status`, and `$new_status`,
         * refer to the old and new comment statuses, respectively.
         *
         * @since 2.7.0
         *
         * @param WP_Comment $comment Comment object.
         */
        do_action("comment_{$old_status}_to_{$new_status}", $comment);
    }
    /**
     * Fires when the status of a specific comment type is in transition.
     *
     * The dynamic portions of the hook name, `$new_status`, and `$comment->comment_type`,
     * refer to the new comment status, and the type of comment, respectively.
     *
     * Typical comment types include an empty string (standard comment), 'pingback',
     * or 'trackback'.
     *
     * @since 2.7.0
     *
     * @param int        $comment_ID The comment ID.
     * @param WP_Comment $comment    Comment object.
     */
    do_action("comment_{$new_status}_{$comment->comment_type}", $comment->comment_ID, $comment);
}

WordPress Version: 4.1

/**
 * Call hooks for when a comment status transition occurs.
 *
 * Calls hooks for comment status transitions. If the new comment status is not the same
 * as the previous comment status, then two hooks will be ran, the first is
 * 'transition_comment_status' with new status, old status, and comment data. The
 * next action called is 'comment_OLDSTATUS_to_NEWSTATUS' the NEWSTATUS is the
 * $new_status parameter and the OLDSTATUS is $old_status parameter; it has the
 * comment data.
 *
 * The final action will run whether or not the comment statuses are the same. The
 * action is named 'comment_NEWSTATUS_COMMENTTYPE', NEWSTATUS is from the $new_status
 * parameter and COMMENTTYPE is comment_type comment data.
 *
 * @since 2.7.0
 *
 * @param string $new_status New comment status.
 * @param string $old_status Previous comment status.
 * @param object $comment Comment data.
 */
function wp_transition_comment_status($new_status, $old_status, $comment)
{
    /*
     * Translate raw statuses to human readable formats for the hooks.
     * This is not a complete list of comment status, it's only the ones
     * that need to be renamed
     */
    $comment_statuses = array(
        0 => 'unapproved',
        'hold' => 'unapproved',
        // wp_set_comment_status() uses "hold"
        1 => 'approved',
        'approve' => 'approved',
    );
    if (isset($comment_statuses[$new_status])) {
        $new_status = $comment_statuses[$new_status];
    }
    if (isset($comment_statuses[$old_status])) {
        $old_status = $comment_statuses[$old_status];
    }
    // Call the hooks
    if ($new_status != $old_status) {
        /**
         * Fires when the comment status is in transition.
         *
         * @since 2.7.0
         *
         * @param int|string $new_status The new comment status.
         * @param int|string $old_status The old comment status.
         * @param object     $comment    The comment data.
         */
        do_action('transition_comment_status', $new_status, $old_status, $comment);
        /**
         * Fires when the comment status is in transition from one specific status to another.
         *
         * The dynamic portions of the hook name, `$old_status`, and `$new_status`,
         * refer to the old and new comment statuses, respectively.
         *
         * @since 2.7.0
         *
         * @param object $comment Comment object.
         */
        do_action("comment_{$old_status}_to_{$new_status}", $comment);
    }
    /**
     * Fires when the status of a specific comment type is in transition.
     *
     * The dynamic portions of the hook name, `$new_status`, and `$comment->comment_type`,
     * refer to the new comment status, and the type of comment, respectively.
     *
     * Typical comment types include an empty string (standard comment), 'pingback',
     * or 'trackback'.
     *
     * @since 2.7.0
     *
     * @param int $comment_ID The comment ID.
     * @param obj $comment    Comment object.
     */
    do_action("comment_{$new_status}_{$comment->comment_type}", $comment->comment_ID, $comment);
}

WordPress Version: 3.8

/**
 * Call hooks for when a comment status transition occurs.
 *
 * Calls hooks for comment status transitions. If the new comment status is not the same
 * as the previous comment status, then two hooks will be ran, the first is
 * 'transition_comment_status' with new status, old status, and comment data. The
 * next action called is 'comment_OLDSTATUS_to_NEWSTATUS' the NEWSTATUS is the
 * $new_status parameter and the OLDSTATUS is $old_status parameter; it has the
 * comment data.
 *
 * The final action will run whether or not the comment statuses are the same. The
 * action is named 'comment_NEWSTATUS_COMMENTTYPE', NEWSTATUS is from the $new_status
 * parameter and COMMENTTYPE is comment_type comment data.
 *
 * @since 2.7.0
 *
 * @param string $new_status New comment status.
 * @param string $old_status Previous comment status.
 * @param object $comment Comment data.
 */
function wp_transition_comment_status($new_status, $old_status, $comment)
{
    /*
     * Translate raw statuses to human readable formats for the hooks.
     * This is not a complete list of comment status, it's only the ones
     * that need to be renamed
     */
    $comment_statuses = array(
        0 => 'unapproved',
        'hold' => 'unapproved',
        // wp_set_comment_status() uses "hold"
        1 => 'approved',
        'approve' => 'approved',
    );
    if (isset($comment_statuses[$new_status])) {
        $new_status = $comment_statuses[$new_status];
    }
    if (isset($comment_statuses[$old_status])) {
        $old_status = $comment_statuses[$old_status];
    }
    // Call the hooks
    if ($new_status != $old_status) {
        /**
         * Fires when the comment status is in transition.
         *
         * @since 2.7.0
         *
         * @param int|string $new_status The new comment status.
         * @param int|string $old_status The old comment status.
         * @param object     $comment    The comment data.
         */
        do_action('transition_comment_status', $new_status, $old_status, $comment);
        /**
         * Fires when the comment status is in transition from one specific status to another.
         *
         * The dynamic portions of the hook name, $old_status, and $new_status,
         * refer to the old and new comment statuses, respectively.
         *
         * @since 2.7.0
         *
         * @param object $comment Comment object.
         */
        do_action("comment_{$old_status}_to_{$new_status}", $comment);
    }
    /**
     * Fires when the status of a specific comment type is in transition.
     *
     * The dynamic portions of the hook name, $new_status, and $comment->comment_type,
     * refer to the new comment status, and the type of comment, respectively.
     *
     * Typical comment types include an empty string (standard comment), 'pingback',
     * or 'trackback'.
     *
     * @since 2.7.0
     *
     * @param int $comment_ID The comment ID.
     * @param obj $comment    Comment object.
     */
    do_action("comment_{$new_status}_{$comment->comment_type}", $comment->comment_ID, $comment);
}

WordPress Version: 3.7

/**
 * Call hooks for when a comment status transition occurs.
 *
 * Calls hooks for comment status transitions. If the new comment status is not the same
 * as the previous comment status, then two hooks will be ran, the first is
 * 'transition_comment_status' with new status, old status, and comment data. The
 * next action called is 'comment_OLDSTATUS_to_NEWSTATUS' the NEWSTATUS is the
 * $new_status parameter and the OLDSTATUS is $old_status parameter; it has the
 * comment data.
 *
 * The final action will run whether or not the comment statuses are the same. The
 * action is named 'comment_NEWSTATUS_COMMENTTYPE', NEWSTATUS is from the $new_status
 * parameter and COMMENTTYPE is comment_type comment data.
 *
 * @since 2.7.0
 *
 * @param string $new_status New comment status.
 * @param string $old_status Previous comment status.
 * @param object $comment Comment data.
 */
function wp_transition_comment_status($new_status, $old_status, $comment)
{
    // Translate raw statuses to human readable formats for the hooks
    // This is not a complete list of comment status, it's only the ones that need to be renamed
    $comment_statuses = array(
        0 => 'unapproved',
        'hold' => 'unapproved',
        // wp_set_comment_status() uses "hold"
        1 => 'approved',
        'approve' => 'approved',
    );
    if (isset($comment_statuses[$new_status])) {
        $new_status = $comment_statuses[$new_status];
    }
    if (isset($comment_statuses[$old_status])) {
        $old_status = $comment_statuses[$old_status];
    }
    // Call the hooks
    if ($new_status != $old_status) {
        do_action('transition_comment_status', $new_status, $old_status, $comment);
        do_action("comment_{$old_status}_to_{$new_status}", $comment);
    }
    do_action("comment_{$new_status}_{$comment->comment_type}", $comment->comment_ID, $comment);
}