Make WordPress Core


Ignore:
Timestamp:
02/12/2023 06:06:33 PM (2 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment-template.php

    r55289 r55308  
    1616 *
    1717 * @since 1.5.0
    18  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
    19  *
    20  * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to retrieve the author.
     18 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
     19 *
     20 * @param int|WP_Comment $comment_id Optional. WP_Comment or the ID of the comment for which to retrieve the author.
    2121 *                                   Default current comment.
    2222 * @return string The comment author
    2323 */
    24 function get_comment_author( $comment_ID = 0 ) {
    25     $comment    = get_comment( $comment_ID );
    26     $comment_ID = ! empty( $comment->comment_ID ) ? $comment->comment_ID : $comment_ID;
     24function get_comment_author( $comment_id = 0 ) {
     25    $comment    = get_comment( $comment_id );
     26    $comment_id = ! empty( $comment->comment_ID ) ? $comment->comment_ID : $comment_id;
    2727
    2828    if ( empty( $comment->comment_author ) ) {
     
    4141     *
    4242     * @since 1.5.0
    43      * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.
     43     * @since 4.1.0 The `$comment_id` and `$comment` parameters were added.
    4444     *
    4545     * @param string     $author     The comment author's username.
    46      * @param string     $comment_ID The comment ID as a numeric string.
     46     * @param string     $comment_id The comment ID as a numeric string.
    4747     * @param WP_Comment $comment    The comment object.
    4848     */
    49     return apply_filters( 'get_comment_author', $author, $comment_ID, $comment );
     49    return apply_filters( 'get_comment_author', $author, $comment_id, $comment );
    5050}
    5151
     
    5454 *
    5555 * @since 0.71
    56  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
    57  *
    58  * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author.
     56 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
     57 *
     58 * @param int|WP_Comment $comment_id Optional. WP_Comment or the ID of the comment for which to print the author.
    5959 *                                   Default current comment.
    6060 */
    61 function comment_author( $comment_ID = 0 ) {
    62     $comment = get_comment( $comment_ID );
     61function comment_author( $comment_id = 0 ) {
     62    $comment = get_comment( $comment_id );
    6363    $author  = get_comment_author( $comment );
    6464
     
    6767     *
    6868     * @since 1.2.0
    69      * @since 4.1.0 The `$comment_ID` parameter was added.
     69     * @since 4.1.0 The `$comment_id` parameter was added.
    7070     *
    7171     * @param string $author     The comment author's username.
    72      * @param string $comment_ID The comment ID as a numeric string.
     72     * @param string $comment_id The comment ID as a numeric string.
    7373     */
    7474    echo apply_filters( 'comment_author', $author, $comment->comment_ID );
     
    7979 *
    8080 * @since 1.5.0
    81  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
    82  *
    83  * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's email.
     81 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
     82 *
     83 * @param int|WP_Comment $comment_id Optional. WP_Comment or the ID of the comment for which to get the author's email.
    8484 *                                   Default current comment.
    8585 * @return string The current comment author's email
    8686 */
    87 function get_comment_author_email( $comment_ID = 0 ) {
    88     $comment = get_comment( $comment_ID );
     87function get_comment_author_email( $comment_id = 0 ) {
     88    $comment = get_comment( $comment_id );
    8989
    9090    /**
     
    9292     *
    9393     * @since 1.5.0
    94      * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.
     94     * @since 4.1.0 The `$comment_id` and `$comment` parameters were added.
    9595     *
    9696     * @param string     $comment_author_email The comment author's email address.
    97      * @param string     $comment_ID           The comment ID as a numeric string.
     97     * @param string     $comment_id           The comment ID as a numeric string.
    9898     * @param WP_Comment $comment              The comment object.
    9999     */
     
    111111 *
    112112 * @since 0.71
    113  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
    114  *
    115  * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's email.
     113 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
     114 *
     115 * @param int|WP_Comment $comment_id Optional. WP_Comment or the ID of the comment for which to print the author's email.
    116116 *                                   Default current comment.
    117117 */
    118 function comment_author_email( $comment_ID = 0 ) {
    119     $comment      = get_comment( $comment_ID );
     118function comment_author_email( $comment_id = 0 ) {
     119    $comment      = get_comment( $comment_id );
    120120    $author_email = get_comment_author_email( $comment );
    121121
     
    124124     *
    125125     * @since 1.2.0
    126      * @since 4.1.0 The `$comment_ID` parameter was added.
     126     * @since 4.1.0 The `$comment_id` parameter was added.
    127127     *
    128128     * @param string $author_email The comment author's email address.
    129      * @param string $comment_ID   The comment ID as a numeric string.
     129     * @param string $comment_id   The comment ID as a numeric string.
    130130     */
    131131    echo apply_filters( 'author_email', $author_email, $comment->comment_ID );
     
    209209 *
    210210 * Both get_comment_author_url() and get_comment_author() rely on get_comment(),
    211  * which falls back to the global comment variable if the $comment_ID argument is empty.
     211 * which falls back to the global comment variable if the $comment_id argument is empty.
    212212 *
    213213 * @since 1.5.0
    214  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
    215  *
    216  * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's link.
     214 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
     215 *
     216 * @param int|WP_Comment $comment_id Optional. WP_Comment or the ID of the comment for which to get the author's link.
    217217 *                                   Default current comment.
    218218 * @return string The comment author name or HTML link for author's URL.
    219219 */
    220 function get_comment_author_link( $comment_ID = 0 ) {
    221     $comment    = get_comment( $comment_ID );
    222     $comment_ID = ! empty( $comment->comment_ID ) ? $comment->comment_ID : (string) $comment_ID;
     220function get_comment_author_link( $comment_id = 0 ) {
     221    $comment    = get_comment( $comment_id );
     222    $comment_id = ! empty( $comment->comment_ID ) ? $comment->comment_ID : (string) $comment_id;
    223223    $url        = get_comment_author_url( $comment );
    224224    $author     = get_comment_author( $comment );
     
    264264     *
    265265     * @since 1.5.0
    266      * @since 4.1.0 The `$author` and `$comment_ID` parameters were added.
     266     * @since 4.1.0 The `$author` and `$comment_id` parameters were added.
    267267     *
    268268     * @param string $return     The HTML-formatted comment author link.
    269269     *                           Empty for an invalid URL.
    270270     * @param string $author     The comment author's username.
    271      * @param string $comment_ID The comment ID as a numeric string.
    272      */
    273     return apply_filters( 'get_comment_author_link', $return, $author, $comment_ID );
     271     * @param string $comment_id The comment ID as a numeric string.
     272     */
     273    return apply_filters( 'get_comment_author_link', $return, $author, $comment_id );
    274274}
    275275
     
    278278 *
    279279 * @since 0.71
    280  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
    281  *
    282  * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's link.
     280 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
     281 *
     282 * @param int|WP_Comment $comment_id Optional. WP_Comment or the ID of the comment for which to print the author's link.
    283283 *                                   Default current comment.
    284284 */
    285 function comment_author_link( $comment_ID = 0 ) {
    286     echo get_comment_author_link( $comment_ID );
     285function comment_author_link( $comment_id = 0 ) {
     286    echo get_comment_author_link( $comment_id );
    287287}
    288288
     
    291291 *
    292292 * @since 1.5.0
    293  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
    294  *
    295  * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's IP address.
     293 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
     294 *
     295 * @param int|WP_Comment $comment_id Optional. WP_Comment or the ID of the comment for which to get the author's IP address.
    296296 *                                   Default current comment.
    297297 * @return string Comment author's IP address, or an empty string if it's not available.
    298298 */
    299 function get_comment_author_IP( $comment_ID = 0 ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
    300     $comment = get_comment( $comment_ID );
     299function get_comment_author_IP( $comment_id = 0 ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
     300    $comment = get_comment( $comment_id );
    301301
    302302    /**
     
    304304     *
    305305     * @since 1.5.0
    306      * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.
     306     * @since 4.1.0 The `$comment_id` and `$comment` parameters were added.
    307307     *
    308308     * @param string     $comment_author_ip The comment author's IP address, or an empty string if it's not available.
    309      * @param string     $comment_ID        The comment ID as a numeric string.
     309     * @param string     $comment_id        The comment ID as a numeric string.
    310310     * @param WP_Comment $comment           The comment object.
    311311     */
     
    317317 *
    318318 * @since 0.71
    319  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
    320  *
    321  * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's IP address.
     319 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
     320 *
     321 * @param int|WP_Comment $comment_id Optional. WP_Comment or the ID of the comment for which to print the author's IP address.
    322322 *                                   Default current comment.
    323323 */
    324 function comment_author_IP( $comment_ID = 0 ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
    325     echo esc_html( get_comment_author_IP( $comment_ID ) );
     324function comment_author_IP( $comment_id = 0 ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
     325    echo esc_html( get_comment_author_IP( $comment_id ) );
    326326}
    327327
     
    330330 *
    331331 * @since 1.5.0
    332  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
    333  *
    334  * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's URL.
     332 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
     333 *
     334 * @param int|WP_Comment $comment_id Optional. WP_Comment or the ID of the comment for which to get the author's URL.
    335335 *                                   Default current comment.
    336336 * @return string Comment author URL, if provided, an empty string otherwise.
    337337 */
    338 function get_comment_author_url( $comment_ID = 0 ) {
    339     $comment = get_comment( $comment_ID );
     338function get_comment_author_url( $comment_id = 0 ) {
     339    $comment = get_comment( $comment_id );
    340340    $url     = '';
    341341    $id      = 0;
     
    351351     *
    352352     * @since 1.5.0
    353      * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.
     353     * @since 4.1.0 The `$comment_id` and `$comment` parameters were added.
    354354     *
    355355     * @param string          $url        The comment author's URL, or an empty string.
    356      * @param string|int      $comment_ID The comment ID as a numeric string, or 0 if not found.
     356     * @param string|int      $comment_id The comment ID as a numeric string, or 0 if not found.
    357357     * @param WP_Comment|null $comment    The comment object, or null if not found.
    358358     */
     
    364364 *
    365365 * @since 0.71
    366  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
    367  *
    368  * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's URL.
     366 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
     367 *
     368 * @param int|WP_Comment $comment_id Optional. WP_Comment or the ID of the comment for which to print the author's URL.
    369369 *                                   Default current comment.
    370370 */
    371 function comment_author_url( $comment_ID = 0 ) {
    372     $comment    = get_comment( $comment_ID );
     371function comment_author_url( $comment_id = 0 ) {
     372    $comment    = get_comment( $comment_id );
    373373    $author_url = get_comment_author_url( $comment );
    374374
     
    377377     *
    378378     * @since 1.2.0
    379      * @since 4.1.0 The `$comment_ID` parameter was added.
     379     * @since 4.1.0 The `$comment_id` parameter was added.
    380380     *
    381381     * @param string $author_url The comment author's URL.
    382      * @param string $comment_ID The comment ID as a numeric string.
     382     * @param string $comment_id The comment ID as a numeric string.
    383383     */
    384384    echo apply_filters( 'comment_url', $author_url, $comment->comment_ID );
     
    576576 *
    577577 * @since 1.5.0
    578  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
     578 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
    579579 *
    580580 * @param string         $format     Optional. PHP date format. Defaults to the 'date_format' option.
    581  * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the date.
     581 * @param int|WP_Comment $comment_id Optional. WP_Comment or ID of the comment for which to get the date.
    582582 *                                   Default current comment.
    583583 * @return string The comment's date.
    584584 */
    585 function get_comment_date( $format = '', $comment_ID = 0 ) {
    586     $comment = get_comment( $comment_ID );
     585function get_comment_date( $format = '', $comment_id = 0 ) {
     586    $comment = get_comment( $comment_id );
    587587
    588588    $_format = ! empty( $format ) ? $format : get_option( 'date_format' );
     
    606606 *
    607607 * @since 0.71
    608  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
     608 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
    609609 *
    610610 * @param string         $format     Optional. PHP date format. Defaults to the 'date_format' option.
    611  * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to print the date.
     611 * @param int|WP_Comment $comment_id WP_Comment or ID of the comment for which to print the date.
    612612 *                                   Default current comment.
    613613 */
    614 function comment_date( $format = '', $comment_ID = 0 ) {
    615     echo get_comment_date( $format, $comment_ID );
     614function comment_date( $format = '', $comment_id = 0 ) {
     615    echo get_comment_date( $format, $comment_id );
    616616}
    617617
     
    622622 *
    623623 * @since 1.5.0
    624  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
    625  *
    626  * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the excerpt.
     624 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
     625 *
     626 * @param int|WP_Comment $comment_id Optional. WP_Comment or ID of the comment for which to get the excerpt.
    627627 *                                   Default current comment.
    628628 * @return string The possibly truncated comment excerpt.
    629629 */
    630 function get_comment_excerpt( $comment_ID = 0 ) {
    631     $comment = get_comment( $comment_ID );
     630function get_comment_excerpt( $comment_id = 0 ) {
     631    $comment = get_comment( $comment_id );
    632632
    633633    if ( ! post_password_required( $comment->comment_post_ID ) ) {
     
    655655     *
    656656     * @since 1.5.0
    657      * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.
     657     * @since 4.1.0 The `$comment_id` and `$comment` parameters were added.
    658658     *
    659659     * @param string     $excerpt    The comment excerpt text.
    660      * @param string     $comment_ID The comment ID as a numeric string.
     660     * @param string     $comment_id The comment ID as a numeric string.
    661661     * @param WP_Comment $comment    The comment object.
    662662     */
     
    668668 *
    669669 * @since 1.2.0
    670  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
    671  *
    672  * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to print the excerpt.
     670 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
     671 *
     672 * @param int|WP_Comment $comment_id Optional. WP_Comment or ID of the comment for which to print the excerpt.
    673673 *                                   Default current comment.
    674674 */
    675 function comment_excerpt( $comment_ID = 0 ) {
    676     $comment         = get_comment( $comment_ID );
     675function comment_excerpt( $comment_id = 0 ) {
     676    $comment         = get_comment( $comment_id );
    677677    $comment_excerpt = get_comment_excerpt( $comment );
    678678
     
    681681     *
    682682     * @since 1.2.0
    683      * @since 4.1.0 The `$comment_ID` parameter was added.
     683     * @since 4.1.0 The `$comment_id` parameter was added.
    684684     *
    685685     * @param string $comment_excerpt The comment excerpt text.
    686      * @param string $comment_ID      The comment ID as a numeric string.
     686     * @param string $comment_id      The comment ID as a numeric string.
    687687     */
    688688    echo apply_filters( 'comment_excerpt', $comment_excerpt, $comment->comment_ID );
     
    698698function get_comment_ID() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
    699699    $comment    = get_comment();
    700     $comment_ID = ! empty( $comment->comment_ID ) ? $comment->comment_ID : '0';
     700    $comment_id = ! empty( $comment->comment_ID ) ? $comment->comment_ID : '0';
    701701
    702702    /**
     
    706706     * @since 4.1.0 The `$comment` parameter was added.
    707707     *
    708      * @param string     $comment_ID The current comment ID as a numeric string.
     708     * @param string     $comment_id The current comment ID as a numeric string.
    709709     * @param WP_Comment $comment    The comment object.
    710710     */
    711     return apply_filters( 'get_comment_ID', $comment_ID, $comment );  // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
     711    return apply_filters( 'get_comment_ID', $comment_id, $comment );  // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
    712712}
    713713
     
    986986 *
    987987 * @since 1.5.0
    988  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
     988 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
    989989 * @since 5.4.0 Added 'In reply to %s.' prefix to child comments in comments feed.
    990990 *
    991991 * @see Walker_Comment::comment()
    992992 *
    993  * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the text.
     993 * @param int|WP_Comment $comment_id Optional. WP_Comment or ID of the comment for which to get the text.
    994994 *                                   Default current comment.
    995995 * @param array          $args       Optional. An array of arguments. Default empty array.
    996996 * @return string The comment content.
    997997 */
    998 function get_comment_text( $comment_ID = 0, $args = array() ) {
    999     $comment = get_comment( $comment_ID );
     998function get_comment_text( $comment_id = 0, $args = array() ) {
     999    $comment = get_comment( $comment_id );
    10001000
    10011001    $comment_content = $comment->comment_content;
     
    10331033 *
    10341034 * @since 0.71
    1035  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
     1035 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
    10361036 *
    10371037 * @see Walker_Comment::comment()
    10381038 *
    1039  * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to print the text.
     1039 * @param int|WP_Comment $comment_id Optional. WP_Comment or ID of the comment for which to print the text.
    10401040 *                                   Default current comment.
    10411041 * @param array          $args       Optional. An array of arguments. Default empty array.
    10421042 */
    1043 function comment_text( $comment_ID = 0, $args = array() ) {
    1044     $comment = get_comment( $comment_ID );
     1043function comment_text( $comment_id = 0, $args = array() ) {
     1044    $comment = get_comment( $comment_id );
    10451045
    10461046    $comment_text = get_comment_text( $comment, $args );
     
    10631063 *
    10641064 * @since 1.5.0
    1065  * @since 6.2.0 Added the `$comment_ID` parameter.
     1065 * @since 6.2.0 Added the `$comment_id` parameter.
    10661066 *
    10671067 * @param string         $format     Optional. PHP date format. Defaults to the 'time_format' option.
     
    10691069 * @param bool           $translate  Optional. Whether to translate the time (for use in feeds).
    10701070 *                                   Default true.
    1071  * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the time.
     1071 * @param int|WP_Comment $comment_id Optional. WP_Comment or ID of the comment for which to get the time.
    10721072 *                                   Default current comment.
    10731073 * @return string The formatted time.
    10741074 */
    1075 function get_comment_time( $format = '', $gmt = false, $translate = true, $comment_ID = 0 ) {
    1076     $comment = get_comment( $comment_ID );
     1075function get_comment_time( $format = '', $gmt = false, $translate = true, $comment_id = 0 ) {
     1076    $comment = get_comment( $comment_id );
    10771077
    10781078    if ( null === $comment ) {
     
    11041104 *
    11051105 * @since 0.71
    1106  * @since 6.2.0 Added the `$comment_ID` parameter.
     1106 * @since 6.2.0 Added the `$comment_id` parameter.
    11071107 *
    11081108 * @param string         $format     Optional. PHP time format. Defaults to the 'time_format' option.
    1109  * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the time.
     1109 * @param int|WP_Comment $comment_id Optional. WP_Comment or ID of the comment for which to print the time.
    11101110 *                                   Default current comment.
    11111111 */
    1112 function comment_time( $format = '', $comment_ID = 0 ) {
    1113     echo get_comment_time( $format, $comment_ID );
     1112function comment_time( $format = '', $comment_id = 0 ) {
     1113    echo get_comment_time( $format, $comment_id );
    11141114}
    11151115
     
    11181118 *
    11191119 * @since 1.5.0
    1120  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
    1121  *
    1122  * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the type.
     1120 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
     1121 *
     1122 * @param int|WP_Comment $comment_id Optional. WP_Comment or ID of the comment for which to get the type.
    11231123 *                                   Default current comment.
    11241124 * @return string The comment type.
    11251125 */
    1126 function get_comment_type( $comment_ID = 0 ) {
    1127     $comment = get_comment( $comment_ID );
     1126function get_comment_type( $comment_id = 0 ) {
     1127    $comment = get_comment( $comment_id );
    11281128
    11291129    if ( '' === $comment->comment_type ) {
     
    11351135     *
    11361136     * @since 1.5.0
    1137      * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added.
     1137     * @since 4.1.0 The `$comment_id` and `$comment` parameters were added.
    11381138     *
    11391139     * @param string     $comment_type The type of comment, such as 'comment', 'pingback', or 'trackback'.
    1140      * @param string     $comment_ID   The comment ID as a numeric string.
     1140     * @param string     $comment_id   The comment ID as a numeric string.
    11411141     * @param WP_Comment $comment      The comment object.
    11421142     */
Note: See TracChangeset for help on using the changeset viewer.