Make WordPress Core

Ticket #57671: 57671.diff

File 57671.diff, 38.9 KB (added by SergeyBiryukov, 4 years ago)
  • src/wp-includes/class-wp-xmlrpc-server.php

     
    37203720
    37213721                $username   = $args[1];
    37223722                $password   = $args[2];
    3723                 $comment_ID = (int) $args[3];
     3723                $comment_id = (int) $args[3];
    37243724
    37253725                $user = $this->login( $username, $password );
    37263726                if ( ! $user ) {
    … …  
    37273727                        return $this->error;
    37283728                }
    37293729
    3730                 if ( ! get_comment( $comment_ID ) ) {
     3730                if ( ! get_comment( $comment_id ) ) {
    37313731                        return new IXR_Error( 404, __( 'Invalid comment ID.' ) );
    37323732                }
    37333733
    3734                 if ( ! current_user_can( 'edit_comment', $comment_ID ) ) {
     3734                if ( ! current_user_can( 'edit_comment', $comment_id ) ) {
    37353735                        return new IXR_Error( 403, __( 'Sorry, you are not allowed to delete this comment.' ) );
    37363736                }
    37373737
    … …  
    37383738                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    37393739                do_action( 'xmlrpc_call', 'wp.deleteComment', $args, $this );
    37403740
    3741                 $status = wp_delete_comment( $comment_ID );
     3741                $status = wp_delete_comment( $comment_id );
    37423742
    37433743                if ( $status ) {
    37443744                        /**
    … …  
    37463746                         *
    37473747                         * @since 3.4.0
    37483748                         *
    3749                          * @param int   $comment_ID ID of the deleted comment.
     3749                         * @param int   $comment_id ID of the deleted comment.
    37503750                         * @param array $args       An array of arguments to delete the comment.
    37513751                         */
    3752                         do_action( 'xmlrpc_call_success_wp_deleteComment', $comment_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
     3752                        do_action( 'xmlrpc_call_success_wp_deleteComment', $comment_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
    37533753                }
    37543754
    37553755                return $status;
    … …  
    37873787
    37883788                $username       = $args[1];
    37893789                $password       = $args[2];
    3790                 $comment_ID     = (int) $args[3];
     3790                $comment_id     = (int) $args[3];
    37913791                $content_struct = $args[4];
    37923792
    37933793                $user = $this->login( $username, $password );
    … …  
    37953795                        return $this->error;
    37963796                }
    37973797
    3798                 if ( ! get_comment( $comment_ID ) ) {
     3798                if ( ! get_comment( $comment_id ) ) {
    37993799                        return new IXR_Error( 404, __( 'Invalid comment ID.' ) );
    38003800                }
    38013801
    3802                 if ( ! current_user_can( 'edit_comment', $comment_ID ) ) {
     3802                if ( ! current_user_can( 'edit_comment', $comment_id ) ) {
    38033803                        return new IXR_Error( 403, __( 'Sorry, you are not allowed to moderate or edit this comment.' ) );
    38043804                }
    38053805
    … …  
    38063806                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    38073807                do_action( 'xmlrpc_call', 'wp.editComment', $args, $this );
    38083808                $comment = array(
    3809                         'comment_ID' => $comment_ID,
     3809                        'comment_ID' => $comment_id,
    38103810                );
    38113811
    38123812                if ( isset( $content_struct['status'] ) ) {
    … …  
    38583858                 *
    38593859                 * @since 3.4.0
    38603860                 *
    3861                  * @param int   $comment_ID ID of the updated comment.
     3861                 * @param int   $comment_id ID of the updated comment.
    38623862                 * @param array $args       An array of arguments to update the comment.
    38633863                 */
    3864                 do_action( 'xmlrpc_call_success_wp_editComment', $comment_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
     3864                do_action( 'xmlrpc_call_success_wp_editComment', $comment_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
    38653865
    38663866                return true;
    38673867        }
    … …  
    39993999                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    40004000                do_action( 'xmlrpc_call', 'wp.newComment', $args, $this );
    40014001
    4002                 $comment_ID = wp_new_comment( $comment, true );
    4003                 if ( is_wp_error( $comment_ID ) ) {
    4004                         return new IXR_Error( 403, $comment_ID->get_error_message() );
     4002                $comment_id = wp_new_comment( $comment, true );
     4003                if ( is_wp_error( $comment_id ) ) {
     4004                        return new IXR_Error( 403, $comment_id->get_error_message() );
    40054005                }
    40064006
    4007                 if ( ! $comment_ID ) {
     4007                if ( ! $comment_id ) {
    40084008                        return new IXR_Error( 403, __( 'Something went wrong.' ) );
    40094009                }
    40104010
    … …  
    40134013                 *
    40144014                 * @since 3.4.0
    40154015                 *
    4016                  * @param int   $comment_ID ID of the new comment.
     4016                 * @param int   $comment_id ID of the new comment.
    40174017                 * @param array $args       An array of new comment arguments.
    40184018                 */
    4019                 do_action( 'xmlrpc_call_success_wp_newComment', $comment_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
     4019                do_action( 'xmlrpc_call_success_wp_newComment', $comment_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
    40204020
    4021                 return $comment_ID;
     4021                return $comment_id;
    40224022        }
    40234023
    40244024        /**
    … …  
    70407040                        'remote_source_original'
    70417041                );
    70427042
    7043                 $comment_ID = wp_new_comment( $commentdata );
     7043                $comment_id = wp_new_comment( $commentdata );
    70447044
    7045                 if ( is_wp_error( $comment_ID ) ) {
    7046                         return $this->pingback_error( 0, $comment_ID->get_error_message() );
     7045                if ( is_wp_error( $comment_id ) ) {
     7046                        return $this->pingback_error( 0, $comment_id->get_error_message() );
    70477047                }
    70487048
    70497049                /**
    … …  
    70517051                 *
    70527052                 * @since 0.71
    70537053                 *
    7054                  * @param int $comment_ID Comment ID.
     7054                 * @param int $comment_id Comment ID.
    70557055                 */
    7056                 do_action( 'pingback_post', $comment_ID );
     7056                do_action( 'pingback_post', $comment_id );
    70577057
    70587058                /* translators: 1: URL of the page linked from, 2: URL of the page linked to. */
    70597059                return sprintf( __( 'Pingback from %1$s to %2$s registered. Keep the web talking! :-)' ), $pagelinkedfrom, $pagelinkedto );
  • src/wp-includes/comment-template.php

     
    1515 * assumed.
    1616 *
    1717 * @since 1.5.0
    18  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
     18 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
    1919 *
    20  * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to retrieve the author.
     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 ) ) {
    2929                $user = ! empty( $comment->user_id ) ? get_userdata( $comment->user_id ) : false;
    … …  
    4040         * Filters the returned comment author name.
    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
    5252/**
    … …  
    5353 * Displays the author of the current comment.
    5454 *
    5555 * @since 0.71
    56  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
     56 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
    5757 *
    58  * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author.
     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
    6565        /**
    … …  
    6666         * Filters the comment author's name for display.
    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 );
    7575}
    … …  
    7878 * Retrieves the email of the author of the current comment.
    7979 *
    8080 * @since 1.5.0
    81  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
     81 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
    8282 *
    83  * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's email.
     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        /**
    9191         * Filters the comment author's returned email address.
    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         */
    100100        return apply_filters( 'get_comment_author_email', $comment->comment_author_email, $comment->comment_ID, $comment );
    … …  
    110110 * address and use it for their own means good and bad.
    111111 *
    112112 * @since 0.71
    113  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
     113 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
    114114 *
    115  * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's email.
     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
    122122        /**
    … …  
    123123         * Filters the comment author's email for display.
    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 );
    132132}
    … …  
    208208 * Retrieves the HTML link to the URL of the author of the current comment.
    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.
     214 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
    215215 *
    216  * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's link.
     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 );
    225225
    … …  
    263263         * Filters the comment author's link for display.
    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.
     271         * @param string $comment_id The comment ID as a numeric string.
    272272         */
    273         return apply_filters( 'get_comment_author_link', $return, $author, $comment_ID );
     273        return apply_filters( 'get_comment_author_link', $return, $author, $comment_id );
    274274}
    275275
    276276/**
    … …  
    277277 * Displays the HTML link to the URL of the author of the current comment.
    278278 *
    279279 * @since 0.71
    280  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
     280 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
    281281 *
    282  * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's link.
     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
    289289/**
    … …  
    290290 * Retrieves the IP address of the author of the current comment.
    291291 *
    292292 * @since 1.5.0
    293  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
     293 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
    294294 *
    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.
     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        /**
    303303         * Filters the comment author's returned IP address.
    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         */
    312312        return apply_filters( 'get_comment_author_IP', $comment->comment_author_IP, $comment->comment_ID, $comment );  // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
    … …  
    316316 * Displays the IP address of the author of the current comment.
    317317 *
    318318 * @since 0.71
    319  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
     319 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
    320320 *
    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.
     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
    328328/**
    … …  
    329329 * Retrieves the URL of the author of the current comment, not linked.
    330330 *
    331331 * @since 1.5.0
    332  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
     332 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
    333333 *
    334  * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's URL.
     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;
    342342
    … …  
    350350         * Filters the comment author's URL.
    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         */
    359359        return apply_filters( 'get_comment_author_url', $url, $id, $comment );
    … …  
    363363 * Displays the URL of the author of the current comment, not linked.
    364364 *
    365365 * @since 0.71
    366  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
     366 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
    367367 *
    368  * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's URL.
     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
    375375        /**
    … …  
    376376         * Filters the comment author's URL for display.
    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 );
    385385}
    … …  
    575575 * Retrieves the comment date of the current comment.
    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' );
    589589
    … …  
    605605 * Displays the comment date of the current comment.
    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
    618618/**
    … …  
    621621 * Returns a maximum of 20 words with an ellipsis appended if necessary.
    622622 *
    623623 * @since 1.5.0
    624  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
     624 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
    625625 *
    626  * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the excerpt.
     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 ) ) {
    634634                $comment_text = strip_tags( str_replace( array( "\n", "\r" ), ' ', $comment->comment_content ) );
    … …  
    654654         * Filters the retrieved comment excerpt.
    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         */
    663663        return apply_filters( 'get_comment_excerpt', $excerpt, $comment->comment_ID, $comment );
    … …  
    667667 * Displays the excerpt of the current comment.
    668668 *
    669669 * @since 1.2.0
    670  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
     670 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
    671671 *
    672  * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to print the excerpt.
     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
    679679        /**
    … …  
    680680         * Filters the comment excerpt for display.
    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 );
    689689}
    … …  
    697697 */
    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        /**
    703703         * Filters the returned comment ID.
    … …  
    705705         * @since 1.5.0
    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
    714714/**
    … …  
    985985 * Retrieves the text of the current comment.
    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;
    10021002
    … …  
    10321032 * Displays the text of the current comment.
    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 );
    10471047        /**
    … …  
    10621062 * Retrieves the comment time of the current comment.
    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.
    10681068 * @param bool           $gmt        Optional. Whether to use the GMT date. Default false.
    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 ) {
    10791079                return '';
    … …  
    11031103 * Displays the comment time of the current 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
    11161116/**
    … …  
    11171117 * Retrieves the comment type of the current comment.
    11181118 *
    11191119 * @since 1.5.0
    1120  * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
     1120 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
    11211121 *
    1122  * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the type.
     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 ) {
    11301130                $comment->comment_type = 'comment';
    … …  
    11341134         * Filters the returned 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         */
    11431143        return apply_filters( 'get_comment_type', $comment->comment_type, $comment->comment_ID, $comment );
  • src/wp-includes/comment.php

     
    10391039 *
    10401040 * @global wpdb $wpdb WordPress database abstraction object.
    10411041 *
    1042  * @param int   $comment_ID Comment ID.
     1042 * @param int   $comment_id Comment ID.
    10431043 * @param array $args {
    10441044 *     Array of optional arguments.
    10451045 *
    … …  
    10491049 *     @type int        $per_page  Per-page count to use when calculating pagination.
    10501050 *                                 Defaults to the value of the 'comments_per_page' option.
    10511051 *     @type int|string $max_depth If greater than 1, comment page will be determined
    1052  *                                 for the top-level parent `$comment_ID`.
     1052 *                                 for the top-level parent `$comment_id`.
    10531053 *                                 Defaults to the value of the 'thread_comments_depth' option.
    10541054 * } *
    10551055 * @return int|null Comment page number or null on error.
    10561056 */
    1057 function get_page_of_comment( $comment_ID, $args = array() ) {
     1057function get_page_of_comment( $comment_id, $args = array() ) {
    10581058        global $wpdb;
    10591059
    10601060        $page = null;
    10611061
    1062         $comment = get_comment( $comment_ID );
     1062        $comment = get_comment( $comment_id );
    10631063        if ( ! $comment ) {
    10641064                return;
    10651065        }
    … …  
    11751175         * Filters the calculated page on which a comment appears.
    11761176         *
    11771177         * @since 4.4.0
    1178          * @since 4.7.0 Introduced the `$comment_ID` parameter.
     1178         * @since 4.7.0 Introduced the `$comment_id` parameter.
    11791179         *
    11801180         * @param int   $page          Comment page.
    11811181         * @param array $args {
    … …  
    11961196         *     @type int    $per_page  Number of comments per page.
    11971197         *     @type int    $max_depth Maximum comment threading depth allowed.
    11981198         * }
    1199          * @param int $comment_ID ID of the comment.
     1199         * @param int $comment_id ID of the comment.
    12001200         */
    1201         return apply_filters( 'get_page_of_comment', (int) $page, $args, $original_args, $comment_ID );
     1201        return apply_filters( 'get_page_of_comment', (int) $page, $args, $original_args, $comment_id );
    12021202}
    12031203
    12041204/**
    … …  
    18371837         *
    18381838         * @since 2.7.0
    18391839         *
    1840          * @param string     $comment_ID The comment ID as a numeric string.
     1840         * @param string     $comment_id The comment ID as a numeric string.
    18411841         * @param WP_Comment $comment    Comment object.
    18421842         */
    18431843        do_action( "comment_{$new_status}_{$comment->comment_type}", $comment->comment_ID, $comment );
    … …  
    22812281                return $commentdata['comment_approved'];
    22822282        }
    22832283
    2284         $comment_ID = wp_insert_comment( $commentdata );
     2284        $comment_id = wp_insert_comment( $commentdata );
    22852285
    2286         if ( ! $comment_ID ) {
     2286        if ( ! $comment_id ) {
    22872287                $fields = array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content' );
    22882288
    22892289                foreach ( $fields as $field ) {
    … …  
    22992299                        return $commentdata['comment_approved'];
    23002300                }
    23012301
    2302                 $comment_ID = wp_insert_comment( $commentdata );
    2303                 if ( ! $comment_ID ) {
     2302                $comment_id = wp_insert_comment( $commentdata );
     2303                if ( ! $comment_id ) {
    23042304                        return false;
    23052305                }
    23062306        }
    … …  
    23112311         * @since 1.2.0
    23122312         * @since 4.5.0 The `$commentdata` parameter was added.
    23132313         *
    2314          * @param int        $comment_ID       The comment ID.
     2314         * @param int        $comment_id       The comment ID.
    23152315         * @param int|string $comment_approved 1 if the comment is approved, 0 if not, 'spam' if spam.
    23162316         * @param array      $commentdata      Comment data.
    23172317         */
    2318         do_action( 'comment_post', $comment_ID, $commentdata['comment_approved'], $commentdata );
     2318        do_action( 'comment_post', $comment_id, $commentdata['comment_approved'], $commentdata );
    23192319
    2320         return $comment_ID;
     2320        return $comment_id;
    23212321}
    23222322
    23232323/**
    … …  
    23252325 *
    23262326 * @since 4.4.0
    23272327 *
    2328  * @param int $comment_ID ID of the comment.
     2328 * @param int $comment_id ID of the comment.
    23292329 * @return bool True on success, false on failure.
    23302330 */
    2331 function wp_new_comment_notify_moderator( $comment_ID ) {
    2332         $comment = get_comment( $comment_ID );
     2331function wp_new_comment_notify_moderator( $comment_id ) {
     2332        $comment = get_comment( $comment_id );
    23332333
    23342334        // Only send notifications for pending comments.
    23352335        $maybe_notify = ( '0' == $comment->comment_approved );
    23362336
    23372337        /** This filter is documented in wp-includes/comment.php */
    2338         $maybe_notify = apply_filters( 'notify_moderator', $maybe_notify, $comment_ID );
     2338        $maybe_notify = apply_filters( 'notify_moderator', $maybe_notify, $comment_id );
    23392339
    23402340        if ( ! $maybe_notify ) {
    23412341                return false;
    23422342        }
    23432343
    2344         return wp_notify_moderator( $comment_ID );
     2344        return wp_notify_moderator( $comment_id );
    23452345}
    23462346
    23472347/**
    … …  
    23522352 * Uses the {@see 'notify_post_author'} filter to determine whether the post author
    23532353 * should be notified when a new comment is added, overriding site setting.
    23542354 *
    2355  * @param int $comment_ID Comment ID.
     2355 * @param int $comment_id Comment ID.
    23562356 * @return bool True on success, false on failure.
    23572357 */
    2358 function wp_new_comment_notify_postauthor( $comment_ID ) {
    2359         $comment = get_comment( $comment_ID );
     2358function wp_new_comment_notify_postauthor( $comment_id ) {
     2359        $comment = get_comment( $comment_id );
    23602360
    23612361        $maybe_notify = get_option( 'comments_notify' );
    23622362
    … …  
    23672367         * @since 4.4.0
    23682368         *
    23692369         * @param bool $maybe_notify Whether to notify the post author about the new comment.
    2370          * @param int  $comment_ID   The ID of the comment for the notification.
     2370         * @param int  $comment_id   The ID of the comment for the notification.
    23712371         */
    2372         $maybe_notify = apply_filters( 'notify_post_author', $maybe_notify, $comment_ID );
     2372        $maybe_notify = apply_filters( 'notify_post_author', $maybe_notify, $comment_id );
    23732373
    23742374        /*
    23752375         * wp_notify_postauthor() checks if notifying the author of their own comment.
    … …  
    23842384                return false;
    23852385        }
    23862386
    2387         return wp_notify_postauthor( $comment_ID );
     2387        return wp_notify_postauthor( $comment_id );
    23882388}
    23892389
    23902390/**
  • src/wp-includes/deprecated.php

     
    12251225}
    12261226
    12271227/**
    1228  * Retrieve an array of comment data about comment $comment_ID.
     1228 * Retrieve an array of comment data about comment $comment_id.
    12291229 *
    12301230 * @since 0.71
    12311231 * @deprecated 2.7.0 Use get_comment()
    12321232 * @see get_comment()
    12331233 *
    1234  * @param int $comment_ID The ID of the comment
     1234 * @param int $comment_id The ID of the comment
    12351235 * @param int $no_cache Whether to use the cache (cast to bool)
    12361236 * @param bool $include_unapproved Whether to include unapproved comments
    12371237 * @return array The comment data
    12381238 */
    1239 function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = false ) {
     1239function get_commentdata( $comment_id, $no_cache = 0, $include_unapproved = false ) {
    12401240        _deprecated_function( __FUNCTION__, '2.7.0', 'get_comment()' );
    1241         return get_comment($comment_ID, ARRAY_A);
     1241        return get_comment($comment_id, ARRAY_A);
    12421242}
    12431243
    12441244/**
  • src/wp-includes/feed-rss2-comments.php

     
    110110                 *
    111111                 * @since 2.1.0
    112112                 *
    113                  * @param int $comment_ID The ID of the comment being displayed.
    114                  * @param int $ID        The ID of the post the comment is connected to.
     113                 * @param int $comment_id      The ID of the comment being displayed.
     114                 * @param int $comment_post_id The ID of the post the comment is connected to.
    115115                 */
    116116                do_action( 'commentrss2_item', $comment->comment_ID, $comment_post->ID );
    117117                ?>
  • src/wp-includes/pluggable.php

     
    18751875                 * @since 4.4.0
    18761876                 *
    18771877                 * @param bool $maybe_notify Whether to notify blog moderator.
    1878                  * @param int  $comment_ID   The id of the comment for the notification.
     1878                 * @param int  $comment_id   The ID of the comment for the notification.
    18791879                 */
    18801880                $maybe_notify = apply_filters( 'notify_moderator', $maybe_notify, $comment_id );
    18811881