Ensure the `wp_set_comment_status` action hook is only documented once.
See #26869. Built from https://develop.svn.wordpress.org/trunk@28214 git-svn-id: http://core.svn.wordpress.org/trunk@28044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
029dd247be
commit
8161668689
|
@ -1187,15 +1187,9 @@ function wp_delete_comment($comment_id, $force_delete = false) {
|
||||||
|
|
||||||
clean_comment_cache($comment_id);
|
clean_comment_cache($comment_id);
|
||||||
|
|
||||||
/**
|
/** This action is documented in wp-includes/comment.php */
|
||||||
* Fires immediately before changing the comment's status to 'delete'.
|
|
||||||
*
|
|
||||||
* @since 1.5.0
|
|
||||||
*
|
|
||||||
* @param int $comment_id The comment ID.
|
|
||||||
* @param string $status The new 'delete' comment status.
|
|
||||||
*/
|
|
||||||
do_action( 'wp_set_comment_status', $comment_id, 'delete' );
|
do_action( 'wp_set_comment_status', $comment_id, 'delete' );
|
||||||
|
|
||||||
wp_transition_comment_status('delete', $comment->comment_approved, $comment);
|
wp_transition_comment_status('delete', $comment->comment_approved, $comment);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1777,17 +1771,17 @@ function wp_set_comment_status($comment_id, $comment_status, $wp_error = false)
|
||||||
$comment = get_comment($comment_id);
|
$comment = get_comment($comment_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires after a comment status has been updated in the database.
|
* Fires immediately before transitioning a comment's status from one to another
|
||||||
*
|
* in the database.
|
||||||
* The hook also fires immediately before comment status transition hooks are fired.
|
|
||||||
*
|
*
|
||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
*
|
*
|
||||||
* @param int $comment_id The comment ID.
|
* @param int $comment_id Comment ID.
|
||||||
* @param string|bool $comment_status The comment status. Possible values include 'hold',
|
* @param string|bool $comment_status Current comment status. Possible values include
|
||||||
* 'approve', 'spam', 'trash', or false.
|
* 'hold', 'approve', 'spam', 'trash', or false.
|
||||||
*/
|
*/
|
||||||
do_action( 'wp_set_comment_status', $comment_id, $comment_status );
|
do_action( 'wp_set_comment_status', $comment_id, $comment_status );
|
||||||
|
|
||||||
wp_transition_comment_status($comment_status, $comment_old->comment_approved, $comment);
|
wp_transition_comment_status($comment_status, $comment_old->comment_approved, $comment);
|
||||||
|
|
||||||
wp_update_comment_count($comment->comment_post_ID);
|
wp_update_comment_count($comment->comment_post_ID);
|
||||||
|
|
Loading…
Reference in New Issue