Docs: Capitalize "ID", when referring to a post ID, term ID, etc. in a more consistent way.

See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48104 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-06-20 12:00:07 +00:00
parent 7179459b79
commit 5e2ef3d937
41 changed files with 162 additions and 147 deletions

View File

@@ -1394,7 +1394,7 @@ function wp_count_comments( $post_id = 0 ) {
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param int|WP_Comment $comment_id Comment ID or WP_Comment object.
* @param bool $force_delete Whether to bypass Trash and force deletion. Default is false.
* @param bool $force_delete Whether to bypass Trash and force deletion. Default false.
* @return bool True on success, false on failure.
*/
function wp_delete_comment( $comment_id, $force_delete = false ) {
@@ -1458,6 +1458,7 @@ function wp_delete_comment( $comment_id, $force_delete = false ) {
do_action( 'wp_set_comment_status', $comment->comment_ID, 'delete' );
wp_transition_comment_status( 'delete', $comment->comment_approved, $comment );
return true;
}
@@ -1508,6 +1509,7 @@ function wp_trash_comment( $comment_id ) {
* @param WP_Comment $comment The trashed comment.
*/
do_action( 'trashed_comment', $comment->comment_ID, $comment );
return true;
}
@@ -1547,6 +1549,7 @@ function wp_untrash_comment( $comment_id ) {
if ( wp_set_comment_status( $comment, $status ) ) {
delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_time' );
delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_status' );
/**
* Fires immediately after a comment is restored from the Trash.
*
@@ -1557,6 +1560,7 @@ function wp_untrash_comment( $comment_id ) {
* @param WP_Comment $comment The untrashed comment.
*/
do_action( 'untrashed_comment', $comment->comment_ID, $comment );
return true;
}
@@ -1593,6 +1597,7 @@ function wp_spam_comment( $comment_id ) {
delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_time' );
add_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', $comment->comment_approved );
add_comment_meta( $comment->comment_ID, '_wp_trash_meta_time', time() );
/**
* Fires immediately after a comment is marked as Spam.
*
@@ -1603,6 +1608,7 @@ function wp_spam_comment( $comment_id ) {
* @param WP_Comment $comment The comment marked as spam.
*/
do_action( 'spammed_comment', $comment->comment_ID, $comment );
return true;
}
@@ -1642,6 +1648,7 @@ function wp_unspam_comment( $comment_id ) {
if ( wp_set_comment_status( $comment, $status ) ) {
delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_status' );
delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_time' );
/**
* Fires immediately after a comment is unmarked as Spam.
*
@@ -1652,6 +1659,7 @@ function wp_unspam_comment( $comment_id ) {
* @param WP_Comment $comment The comment unmarked as spam.
*/
do_action( 'unspammed_comment', $comment->comment_ID, $comment );
return true;
}
@@ -1985,7 +1993,7 @@ function wp_insert_comment( $commentdata ) {
function wp_filter_comment( $commentdata ) {
if ( isset( $commentdata['user_ID'] ) ) {
/**
* Filters the comment author's user id before it is set.
* Filters the comment author's user ID before it is set.
*
* The first time this filter is evaluated, 'user_ID' is checked
* (for back-compat), followed by the standard 'user_id' value.
@@ -2279,7 +2287,7 @@ function wp_new_comment_notify_postauthor( $comment_ID ) {
*
* @param int|WP_Comment $comment_id Comment ID or WP_Comment object.
* @param string $comment_status New comment status, either 'hold', 'approve', 'spam', or 'trash'.
* @param bool $wp_error Whether to return a WP_Error object if there is a failure. Default is false.
* @param bool $wp_error Whether to return a WP_Error object if there is a failure. Default false.
* @return bool|WP_Error True on success, false or WP_Error on failure.
*/
function wp_set_comment_status( $comment_id, $comment_status, $wp_error = false ) {
@@ -2427,6 +2435,7 @@ function wp_update_comment( $commentarr ) {
clean_comment_cache( $comment_ID );
wp_update_comment_count( $comment_post_ID );
/**
* Fires immediately after a comment is updated in the database.
*
@@ -2439,8 +2448,11 @@ function wp_update_comment( $commentarr ) {
* @param array $data Comment data.
*/
do_action( 'edit_comment', $comment_ID, $data );
$comment = get_comment( $comment_ID );
wp_transition_comment_status( $comment->comment_approved, $old_status, $comment );
return $rval;
}