mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-02 11:44:33 +00:00
Coding Standards: Rename $comment_ID variable to $comment_id in various files.
This resolves 80+ WPCS warnings in core:
{{{
Variable "$comment_ID" is not in valid snake_case format
}}}
While matching the database field of the same name, the `$comment_ID` variable did not follow the WordPress coding standards, and is now renamed to address that.
This affects:
* Function parameters in:
* `get_comment_author()`
* `comment_author()`
* `get_comment_author_email()`
* `comment_author_email()`
* `get_comment_author_link()`
* `comment_author_link()`
* `get_comment_author_IP()`
* `comment_author_IP()`
* `get_comment_author_rl()`
* `comment_author_url()`
* `get_comment_date()`
* `comment_date()`
* `get_comment_excerpt()`
* `comment_excerpt()`
* `get_comment_text()`
* `comment_text()`
* `get_comment_time()`
* `comment_time()`
* `get_comment_type()`
* `get_page_of_comment()`
* `wp_new_comment_notify_moderator()`
* `wp_new_comment_notify_postauthor()`
* `get_commentdata()`
* Internal variables in:
* `get_comment_ID()`
* `wp_new_comment()`
* `wp_xmlrpc_server::wp_deleteComment()`
* `wp_xmlrpc_server::wp_editComment()`
* `wp_xmlrpc_server::wp_newComment()`
* `wp_xmlrpc_server::pingback_ping()`
* Hook parameters in:
* `get_comment_author`
* `comment_author`
* `get_comment_author_email`
* `author_email`
* `get_comment_author_link`
* `get_comment_author_IP`
* `get_comment_author_url`
* `comment_url`
* `get_comment_excerpt`
* `comment_excerpt`
* `get_comment_ID`
* `get_comment_type`
* `get_page_of_comment`
* `comment_{$new_status}_{$comment->comment_type}`
* `comment_post`
* `notify_moderator`
* `notify_post_author`
* `commentrss2_item`
* `xmlrpc_call_success_wp_deleteComment`
* `xmlrpc_call_success_wp_editComment`
* `xmlrpc_call_success_wp_newComment`
* `pingback_post`
Note: The name change only affects variable names and DocBlocks.
The change does not affect:
* `comment_ID` as the `$orderby` value in `WP_Comment_Query::__construct()`
* `comment_ID` as the `$orderby` value in `WP_Comment::get_children()`
* `comment_ID` as part of `$commentarr` parameter in `wp_update_comment()`
The associated array keys still match the database field.
Follow-up to [53723].
Props krunal265, costdev, SergeyBiryukov.
Fixes #57671. See #56791.
git-svn-id: https://develop.svn.wordpress.org/trunk@55308 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1225,20 +1225,20 @@ function gzip_compression() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an array of comment data about comment $comment_ID.
|
||||
* Retrieve an array of comment data about comment $comment_id.
|
||||
*
|
||||
* @since 0.71
|
||||
* @deprecated 2.7.0 Use get_comment()
|
||||
* @see get_comment()
|
||||
*
|
||||
* @param int $comment_ID The ID of the comment
|
||||
* @param int $comment_id The ID of the comment
|
||||
* @param int $no_cache Whether to use the cache (cast to bool)
|
||||
* @param bool $include_unapproved Whether to include unapproved comments
|
||||
* @return array The comment data
|
||||
*/
|
||||
function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = false ) {
|
||||
function get_commentdata( $comment_id, $no_cache = 0, $include_unapproved = false ) {
|
||||
_deprecated_function( __FUNCTION__, '2.7.0', 'get_comment()' );
|
||||
return get_comment($comment_ID, ARRAY_A);
|
||||
return get_comment($comment_id, ARRAY_A);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user