comment_unapproved_to_spam хук-событиеWP 2.7.0

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.

Это один из вариантов динамического хука comment_(old_status)_to_(new_status)

Использование

add_action( 'comment_unapproved_to_spam', 'wp_kama_comment_unapproved_to_spam_action' );

/**
 * Function for `comment_unapproved_to_spam` action-hook.
 * 
 * @param WP_Comment $comment Comment object.
 *
 * @return void
 */
function wp_kama_comment_unapproved_to_spam_action( $comment ){

	// action...
}
$comment(WP_Comment)
Comment object.

Список изменений

С версии 2.7.0 Введена.

Где вызывается хук

wp_transition_comment_status()
comment_unapproved_to_spam
wp-includes/comment.php 1818
do_action( "comment_{$old_status}_to_{$new_status}", $comment );

Где используется хук в WordPress

Использование не найдено.