diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index 0c574475b1..7ff8644d6c 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -3720,25 +3720,25 @@ class wp_xmlrpc_server extends IXR_Server { $username = $args[1]; $password = $args[2]; - $comment_ID = (int) $args[3]; + $comment_id = (int) $args[3]; $user = $this->login( $username, $password ); if ( ! $user ) { return $this->error; } - if ( ! get_comment( $comment_ID ) ) { + if ( ! get_comment( $comment_id ) ) { return new IXR_Error( 404, __( 'Invalid comment ID.' ) ); } - if ( ! current_user_can( 'edit_comment', $comment_ID ) ) { + if ( ! current_user_can( 'edit_comment', $comment_id ) ) { return new IXR_Error( 403, __( 'Sorry, you are not allowed to delete this comment.' ) ); } /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ do_action( 'xmlrpc_call', 'wp.deleteComment', $args, $this ); - $status = wp_delete_comment( $comment_ID ); + $status = wp_delete_comment( $comment_id ); if ( $status ) { /** @@ -3746,10 +3746,10 @@ class wp_xmlrpc_server extends IXR_Server { * * @since 3.4.0 * - * @param int $comment_ID ID of the deleted comment. + * @param int $comment_id ID of the deleted comment. * @param array $args An array of arguments to delete the comment. */ - do_action( 'xmlrpc_call_success_wp_deleteComment', $comment_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase + do_action( 'xmlrpc_call_success_wp_deleteComment', $comment_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase } return $status; @@ -3787,7 +3787,7 @@ class wp_xmlrpc_server extends IXR_Server { $username = $args[1]; $password = $args[2]; - $comment_ID = (int) $args[3]; + $comment_id = (int) $args[3]; $content_struct = $args[4]; $user = $this->login( $username, $password ); @@ -3795,18 +3795,18 @@ class wp_xmlrpc_server extends IXR_Server { return $this->error; } - if ( ! get_comment( $comment_ID ) ) { + if ( ! get_comment( $comment_id ) ) { return new IXR_Error( 404, __( 'Invalid comment ID.' ) ); } - if ( ! current_user_can( 'edit_comment', $comment_ID ) ) { + if ( ! current_user_can( 'edit_comment', $comment_id ) ) { return new IXR_Error( 403, __( 'Sorry, you are not allowed to moderate or edit this comment.' ) ); } /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ do_action( 'xmlrpc_call', 'wp.editComment', $args, $this ); $comment = array( - 'comment_ID' => $comment_ID, + 'comment_ID' => $comment_id, ); if ( isset( $content_struct['status'] ) ) { @@ -3858,10 +3858,10 @@ class wp_xmlrpc_server extends IXR_Server { * * @since 3.4.0 * - * @param int $comment_ID ID of the updated comment. + * @param int $comment_id ID of the updated comment. * @param array $args An array of arguments to update the comment. */ - do_action( 'xmlrpc_call_success_wp_editComment', $comment_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase + do_action( 'xmlrpc_call_success_wp_editComment', $comment_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase return true; } @@ -3999,12 +3999,12 @@ class wp_xmlrpc_server extends IXR_Server { /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ do_action( 'xmlrpc_call', 'wp.newComment', $args, $this ); - $comment_ID = wp_new_comment( $comment, true ); - if ( is_wp_error( $comment_ID ) ) { - return new IXR_Error( 403, $comment_ID->get_error_message() ); + $comment_id = wp_new_comment( $comment, true ); + if ( is_wp_error( $comment_id ) ) { + return new IXR_Error( 403, $comment_id->get_error_message() ); } - if ( ! $comment_ID ) { + if ( ! $comment_id ) { return new IXR_Error( 403, __( 'Something went wrong.' ) ); } @@ -4013,12 +4013,12 @@ class wp_xmlrpc_server extends IXR_Server { * * @since 3.4.0 * - * @param int $comment_ID ID of the new comment. + * @param int $comment_id ID of the new comment. * @param array $args An array of new comment arguments. */ - do_action( 'xmlrpc_call_success_wp_newComment', $comment_ID, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase + do_action( 'xmlrpc_call_success_wp_newComment', $comment_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase - return $comment_ID; + return $comment_id; } /** @@ -7040,10 +7040,10 @@ class wp_xmlrpc_server extends IXR_Server { 'remote_source_original' ); - $comment_ID = wp_new_comment( $commentdata ); + $comment_id = wp_new_comment( $commentdata ); - if ( is_wp_error( $comment_ID ) ) { - return $this->pingback_error( 0, $comment_ID->get_error_message() ); + if ( is_wp_error( $comment_id ) ) { + return $this->pingback_error( 0, $comment_id->get_error_message() ); } /** @@ -7051,9 +7051,9 @@ class wp_xmlrpc_server extends IXR_Server { * * @since 0.71 * - * @param int $comment_ID Comment ID. + * @param int $comment_id Comment ID. */ - do_action( 'pingback_post', $comment_ID ); + do_action( 'pingback_post', $comment_id ); /* translators: 1: URL of the page linked from, 2: URL of the page linked to. */ return sprintf( __( 'Pingback from %1$s to %2$s registered. Keep the web talking! :-)' ), $pagelinkedfrom, $pagelinkedto ); diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index b5cbdc5cbe..cc5b89262b 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -15,15 +15,15 @@ * assumed. * * @since 1.5.0 - * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. + * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object. * - * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to retrieve the author. + * @param int|WP_Comment $comment_id Optional. WP_Comment or the ID of the comment for which to retrieve the author. * Default current comment. * @return string The comment author */ -function get_comment_author( $comment_ID = 0 ) { - $comment = get_comment( $comment_ID ); - $comment_ID = ! empty( $comment->comment_ID ) ? $comment->comment_ID : $comment_ID; +function get_comment_author( $comment_id = 0 ) { + $comment = get_comment( $comment_id ); + $comment_id = ! empty( $comment->comment_ID ) ? $comment->comment_ID : $comment_id; if ( empty( $comment->comment_author ) ) { $user = ! empty( $comment->user_id ) ? get_userdata( $comment->user_id ) : false; @@ -40,36 +40,36 @@ function get_comment_author( $comment_ID = 0 ) { * Filters the returned comment author name. * * @since 1.5.0 - * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added. + * @since 4.1.0 The `$comment_id` and `$comment` parameters were added. * * @param string $author The comment author's username. - * @param string $comment_ID The comment ID as a numeric string. + * @param string $comment_id The comment ID as a numeric string. * @param WP_Comment $comment The comment object. */ - return apply_filters( 'get_comment_author', $author, $comment_ID, $comment ); + return apply_filters( 'get_comment_author', $author, $comment_id, $comment ); } /** * Displays the author of the current comment. * * @since 0.71 - * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. + * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object. * - * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author. + * @param int|WP_Comment $comment_id Optional. WP_Comment or the ID of the comment for which to print the author. * Default current comment. */ -function comment_author( $comment_ID = 0 ) { - $comment = get_comment( $comment_ID ); +function comment_author( $comment_id = 0 ) { + $comment = get_comment( $comment_id ); $author = get_comment_author( $comment ); /** * Filters the comment author's name for display. * * @since 1.2.0 - * @since 4.1.0 The `$comment_ID` parameter was added. + * @since 4.1.0 The `$comment_id` parameter was added. * * @param string $author The comment author's username. - * @param string $comment_ID The comment ID as a numeric string. + * @param string $comment_id The comment ID as a numeric string. */ echo apply_filters( 'comment_author', $author, $comment->comment_ID ); } @@ -78,23 +78,23 @@ function comment_author( $comment_ID = 0 ) { * Retrieves the email of the author of the current comment. * * @since 1.5.0 - * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. + * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object. * - * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's email. + * @param int|WP_Comment $comment_id Optional. WP_Comment or the ID of the comment for which to get the author's email. * Default current comment. * @return string The current comment author's email */ -function get_comment_author_email( $comment_ID = 0 ) { - $comment = get_comment( $comment_ID ); +function get_comment_author_email( $comment_id = 0 ) { + $comment = get_comment( $comment_id ); /** * Filters the comment author's returned email address. * * @since 1.5.0 - * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added. + * @since 4.1.0 The `$comment_id` and `$comment` parameters were added. * * @param string $comment_author_email The comment author's email address. - * @param string $comment_ID The comment ID as a numeric string. + * @param string $comment_id The comment ID as a numeric string. * @param WP_Comment $comment The comment object. */ return apply_filters( 'get_comment_author_email', $comment->comment_author_email, $comment->comment_ID, $comment ); @@ -110,23 +110,23 @@ function get_comment_author_email( $comment_ID = 0 ) { * address and use it for their own means good and bad. * * @since 0.71 - * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. + * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object. * - * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's email. + * @param int|WP_Comment $comment_id Optional. WP_Comment or the ID of the comment for which to print the author's email. * Default current comment. */ -function comment_author_email( $comment_ID = 0 ) { - $comment = get_comment( $comment_ID ); +function comment_author_email( $comment_id = 0 ) { + $comment = get_comment( $comment_id ); $author_email = get_comment_author_email( $comment ); /** * Filters the comment author's email for display. * * @since 1.2.0 - * @since 4.1.0 The `$comment_ID` parameter was added. + * @since 4.1.0 The `$comment_id` parameter was added. * * @param string $author_email The comment author's email address. - * @param string $comment_ID The comment ID as a numeric string. + * @param string $comment_id The comment ID as a numeric string. */ echo apply_filters( 'author_email', $author_email, $comment->comment_ID ); } @@ -208,18 +208,18 @@ function get_comment_author_email_link( $linktext = '', $before = '', $after = ' * Retrieves the HTML link to the URL of the author of the current comment. * * Both get_comment_author_url() and get_comment_author() rely on get_comment(), - * which falls back to the global comment variable if the $comment_ID argument is empty. + * which falls back to the global comment variable if the $comment_id argument is empty. * * @since 1.5.0 - * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. + * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object. * - * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's link. + * @param int|WP_Comment $comment_id Optional. WP_Comment or the ID of the comment for which to get the author's link. * Default current comment. * @return string The comment author name or HTML link for author's URL. */ -function get_comment_author_link( $comment_ID = 0 ) { - $comment = get_comment( $comment_ID ); - $comment_ID = ! empty( $comment->comment_ID ) ? $comment->comment_ID : (string) $comment_ID; +function get_comment_author_link( $comment_id = 0 ) { + $comment = get_comment( $comment_id ); + $comment_id = ! empty( $comment->comment_ID ) ? $comment->comment_ID : (string) $comment_id; $url = get_comment_author_url( $comment ); $author = get_comment_author( $comment ); @@ -263,50 +263,50 @@ function get_comment_author_link( $comment_ID = 0 ) { * Filters the comment author's link for display. * * @since 1.5.0 - * @since 4.1.0 The `$author` and `$comment_ID` parameters were added. + * @since 4.1.0 The `$author` and `$comment_id` parameters were added. * * @param string $return The HTML-formatted comment author link. * Empty for an invalid URL. * @param string $author The comment author's username. - * @param string $comment_ID The comment ID as a numeric string. + * @param string $comment_id The comment ID as a numeric string. */ - return apply_filters( 'get_comment_author_link', $return, $author, $comment_ID ); + return apply_filters( 'get_comment_author_link', $return, $author, $comment_id ); } /** * Displays the HTML link to the URL of the author of the current comment. * * @since 0.71 - * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. + * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object. * - * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's link. + * @param int|WP_Comment $comment_id Optional. WP_Comment or the ID of the comment for which to print the author's link. * Default current comment. */ -function comment_author_link( $comment_ID = 0 ) { - echo get_comment_author_link( $comment_ID ); +function comment_author_link( $comment_id = 0 ) { + echo get_comment_author_link( $comment_id ); } /** * Retrieves the IP address of the author of the current comment. * * @since 1.5.0 - * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. + * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object. * - * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's IP address. + * @param int|WP_Comment $comment_id Optional. WP_Comment or the ID of the comment for which to get the author's IP address. * Default current comment. * @return string Comment author's IP address, or an empty string if it's not available. */ -function get_comment_author_IP( $comment_ID = 0 ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid - $comment = get_comment( $comment_ID ); +function get_comment_author_IP( $comment_id = 0 ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid + $comment = get_comment( $comment_id ); /** * Filters the comment author's returned IP address. * * @since 1.5.0 - * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added. + * @since 4.1.0 The `$comment_id` and `$comment` parameters were added. * * @param string $comment_author_ip The comment author's IP address, or an empty string if it's not available. - * @param string $comment_ID The comment ID as a numeric string. + * @param string $comment_id The comment ID as a numeric string. * @param WP_Comment $comment The comment object. */ return apply_filters( 'get_comment_author_IP', $comment->comment_author_IP, $comment->comment_ID, $comment ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase @@ -316,27 +316,27 @@ function get_comment_author_IP( $comment_ID = 0 ) { // phpcs:ignore WordPress.Na * Displays the IP address of the author of the current comment. * * @since 0.71 - * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. + * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object. * - * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's IP address. + * @param int|WP_Comment $comment_id Optional. WP_Comment or the ID of the comment for which to print the author's IP address. * Default current comment. */ -function comment_author_IP( $comment_ID = 0 ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid - echo esc_html( get_comment_author_IP( $comment_ID ) ); +function comment_author_IP( $comment_id = 0 ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid + echo esc_html( get_comment_author_IP( $comment_id ) ); } /** * Retrieves the URL of the author of the current comment, not linked. * * @since 1.5.0 - * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. + * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object. * - * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's URL. + * @param int|WP_Comment $comment_id Optional. WP_Comment or the ID of the comment for which to get the author's URL. * Default current comment. * @return string Comment author URL, if provided, an empty string otherwise. */ -function get_comment_author_url( $comment_ID = 0 ) { - $comment = get_comment( $comment_ID ); +function get_comment_author_url( $comment_id = 0 ) { + $comment = get_comment( $comment_id ); $url = ''; $id = 0; @@ -350,10 +350,10 @@ function get_comment_author_url( $comment_ID = 0 ) { * Filters the comment author's URL. * * @since 1.5.0 - * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added. + * @since 4.1.0 The `$comment_id` and `$comment` parameters were added. * * @param string $url The comment author's URL, or an empty string. - * @param string|int $comment_ID The comment ID as a numeric string, or 0 if not found. + * @param string|int $comment_id The comment ID as a numeric string, or 0 if not found. * @param WP_Comment|null $comment The comment object, or null if not found. */ return apply_filters( 'get_comment_author_url', $url, $id, $comment ); @@ -363,23 +363,23 @@ function get_comment_author_url( $comment_ID = 0 ) { * Displays the URL of the author of the current comment, not linked. * * @since 0.71 - * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. + * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object. * - * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's URL. + * @param int|WP_Comment $comment_id Optional. WP_Comment or the ID of the comment for which to print the author's URL. * Default current comment. */ -function comment_author_url( $comment_ID = 0 ) { - $comment = get_comment( $comment_ID ); +function comment_author_url( $comment_id = 0 ) { + $comment = get_comment( $comment_id ); $author_url = get_comment_author_url( $comment ); /** * Filters the comment author's URL for display. * * @since 1.2.0 - * @since 4.1.0 The `$comment_ID` parameter was added. + * @since 4.1.0 The `$comment_id` parameter was added. * * @param string $author_url The comment author's URL. - * @param string $comment_ID The comment ID as a numeric string. + * @param string $comment_id The comment ID as a numeric string. */ echo apply_filters( 'comment_url', $author_url, $comment->comment_ID ); } @@ -575,15 +575,15 @@ function get_comment_class( $css_class = '', $comment_id = null, $post = null ) * Retrieves the comment date of the current comment. * * @since 1.5.0 - * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. + * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object. * * @param string $format Optional. PHP date format. Defaults to the 'date_format' option. - * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the date. + * @param int|WP_Comment $comment_id Optional. WP_Comment or ID of the comment for which to get the date. * Default current comment. * @return string The comment's date. */ -function get_comment_date( $format = '', $comment_ID = 0 ) { - $comment = get_comment( $comment_ID ); +function get_comment_date( $format = '', $comment_id = 0 ) { + $comment = get_comment( $comment_id ); $_format = ! empty( $format ) ? $format : get_option( 'date_format' ); @@ -605,14 +605,14 @@ function get_comment_date( $format = '', $comment_ID = 0 ) { * Displays the comment date of the current comment. * * @since 0.71 - * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. + * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object. * * @param string $format Optional. PHP date format. Defaults to the 'date_format' option. - * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to print the date. + * @param int|WP_Comment $comment_id WP_Comment or ID of the comment for which to print the date. * Default current comment. */ -function comment_date( $format = '', $comment_ID = 0 ) { - echo get_comment_date( $format, $comment_ID ); +function comment_date( $format = '', $comment_id = 0 ) { + echo get_comment_date( $format, $comment_id ); } /** @@ -621,14 +621,14 @@ function comment_date( $format = '', $comment_ID = 0 ) { * Returns a maximum of 20 words with an ellipsis appended if necessary. * * @since 1.5.0 - * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. + * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object. * - * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the excerpt. + * @param int|WP_Comment $comment_id Optional. WP_Comment or ID of the comment for which to get the excerpt. * Default current comment. * @return string The possibly truncated comment excerpt. */ -function get_comment_excerpt( $comment_ID = 0 ) { - $comment = get_comment( $comment_ID ); +function get_comment_excerpt( $comment_id = 0 ) { + $comment = get_comment( $comment_id ); if ( ! post_password_required( $comment->comment_post_ID ) ) { $comment_text = strip_tags( str_replace( array( "\n", "\r" ), ' ', $comment->comment_content ) ); @@ -654,10 +654,10 @@ function get_comment_excerpt( $comment_ID = 0 ) { * Filters the retrieved comment excerpt. * * @since 1.5.0 - * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added. + * @since 4.1.0 The `$comment_id` and `$comment` parameters were added. * * @param string $excerpt The comment excerpt text. - * @param string $comment_ID The comment ID as a numeric string. + * @param string $comment_id The comment ID as a numeric string. * @param WP_Comment $comment The comment object. */ return apply_filters( 'get_comment_excerpt', $excerpt, $comment->comment_ID, $comment ); @@ -667,23 +667,23 @@ function get_comment_excerpt( $comment_ID = 0 ) { * Displays the excerpt of the current comment. * * @since 1.2.0 - * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. + * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object. * - * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to print the excerpt. + * @param int|WP_Comment $comment_id Optional. WP_Comment or ID of the comment for which to print the excerpt. * Default current comment. */ -function comment_excerpt( $comment_ID = 0 ) { - $comment = get_comment( $comment_ID ); +function comment_excerpt( $comment_id = 0 ) { + $comment = get_comment( $comment_id ); $comment_excerpt = get_comment_excerpt( $comment ); /** * Filters the comment excerpt for display. * * @since 1.2.0 - * @since 4.1.0 The `$comment_ID` parameter was added. + * @since 4.1.0 The `$comment_id` parameter was added. * * @param string $comment_excerpt The comment excerpt text. - * @param string $comment_ID The comment ID as a numeric string. + * @param string $comment_id The comment ID as a numeric string. */ echo apply_filters( 'comment_excerpt', $comment_excerpt, $comment->comment_ID ); } @@ -697,7 +697,7 @@ function comment_excerpt( $comment_ID = 0 ) { */ function get_comment_ID() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid $comment = get_comment(); - $comment_ID = ! empty( $comment->comment_ID ) ? $comment->comment_ID : '0'; + $comment_id = ! empty( $comment->comment_ID ) ? $comment->comment_ID : '0'; /** * Filters the returned comment ID. @@ -705,10 +705,10 @@ function get_comment_ID() { // phpcs:ignore WordPress.NamingConventions.ValidFun * @since 1.5.0 * @since 4.1.0 The `$comment` parameter was added. * - * @param string $comment_ID The current comment ID as a numeric string. + * @param string $comment_id The current comment ID as a numeric string. * @param WP_Comment $comment The comment object. */ - return apply_filters( 'get_comment_ID', $comment_ID, $comment ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase + return apply_filters( 'get_comment_ID', $comment_id, $comment ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase } /** @@ -985,18 +985,18 @@ function get_comments_number_text( $zero = false, $one = false, $more = false, $ * Retrieves the text of the current comment. * * @since 1.5.0 - * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. + * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object. * @since 5.4.0 Added 'In reply to %s.' prefix to child comments in comments feed. * * @see Walker_Comment::comment() * - * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the text. + * @param int|WP_Comment $comment_id Optional. WP_Comment or ID of the comment for which to get the text. * Default current comment. * @param array $args Optional. An array of arguments. Default empty array. * @return string The comment content. */ -function get_comment_text( $comment_ID = 0, $args = array() ) { - $comment = get_comment( $comment_ID ); +function get_comment_text( $comment_id = 0, $args = array() ) { + $comment = get_comment( $comment_id ); $comment_content = $comment->comment_content; @@ -1032,16 +1032,16 @@ function get_comment_text( $comment_ID = 0, $args = array() ) { * Displays the text of the current comment. * * @since 0.71 - * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. + * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object. * * @see Walker_Comment::comment() * - * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to print the text. + * @param int|WP_Comment $comment_id Optional. WP_Comment or ID of the comment for which to print the text. * Default current comment. * @param array $args Optional. An array of arguments. Default empty array. */ -function comment_text( $comment_ID = 0, $args = array() ) { - $comment = get_comment( $comment_ID ); +function comment_text( $comment_id = 0, $args = array() ) { + $comment = get_comment( $comment_id ); $comment_text = get_comment_text( $comment, $args ); /** @@ -1062,18 +1062,18 @@ function comment_text( $comment_ID = 0, $args = array() ) { * Retrieves the comment time of the current comment. * * @since 1.5.0 - * @since 6.2.0 Added the `$comment_ID` parameter. + * @since 6.2.0 Added the `$comment_id` parameter. * * @param string $format Optional. PHP date format. Defaults to the 'time_format' option. * @param bool $gmt Optional. Whether to use the GMT date. Default false. * @param bool $translate Optional. Whether to translate the time (for use in feeds). * Default true. - * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the time. + * @param int|WP_Comment $comment_id Optional. WP_Comment or ID of the comment for which to get the time. * Default current comment. * @return string The formatted time. */ -function get_comment_time( $format = '', $gmt = false, $translate = true, $comment_ID = 0 ) { - $comment = get_comment( $comment_ID ); +function get_comment_time( $format = '', $gmt = false, $translate = true, $comment_id = 0 ) { + $comment = get_comment( $comment_id ); if ( null === $comment ) { return ''; @@ -1103,28 +1103,28 @@ function get_comment_time( $format = '', $gmt = false, $translate = true, $comme * Displays the comment time of the current comment. * * @since 0.71 - * @since 6.2.0 Added the `$comment_ID` parameter. + * @since 6.2.0 Added the `$comment_id` parameter. * * @param string $format Optional. PHP time format. Defaults to the 'time_format' option. - * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the time. + * @param int|WP_Comment $comment_id Optional. WP_Comment or ID of the comment for which to print the time. * Default current comment. */ -function comment_time( $format = '', $comment_ID = 0 ) { - echo get_comment_time( $format, $comment_ID ); +function comment_time( $format = '', $comment_id = 0 ) { + echo get_comment_time( $format, $comment_id ); } /** * Retrieves the comment type of the current comment. * * @since 1.5.0 - * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. + * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object. * - * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the type. + * @param int|WP_Comment $comment_id Optional. WP_Comment or ID of the comment for which to get the type. * Default current comment. * @return string The comment type. */ -function get_comment_type( $comment_ID = 0 ) { - $comment = get_comment( $comment_ID ); +function get_comment_type( $comment_id = 0 ) { + $comment = get_comment( $comment_id ); if ( '' === $comment->comment_type ) { $comment->comment_type = 'comment'; @@ -1134,10 +1134,10 @@ function get_comment_type( $comment_ID = 0 ) { * Filters the returned comment type. * * @since 1.5.0 - * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added. + * @since 4.1.0 The `$comment_id` and `$comment` parameters were added. * * @param string $comment_type The type of comment, such as 'comment', 'pingback', or 'trackback'. - * @param string $comment_ID The comment ID as a numeric string. + * @param string $comment_id The comment ID as a numeric string. * @param WP_Comment $comment The comment object. */ return apply_filters( 'get_comment_type', $comment->comment_type, $comment->comment_ID, $comment ); diff --git a/wp-includes/comment.php b/wp-includes/comment.php index e3d869e9f6..d09dc4967c 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -1039,7 +1039,7 @@ function get_comment_pages_count( $comments = null, $per_page = null, $threaded * * @global wpdb $wpdb WordPress database abstraction object. * - * @param int $comment_ID Comment ID. + * @param int $comment_id Comment ID. * @param array $args { * Array of optional arguments. * @@ -1049,17 +1049,17 @@ function get_comment_pages_count( $comments = null, $per_page = null, $threaded * @type int $per_page Per-page count to use when calculating pagination. * Defaults to the value of the 'comments_per_page' option. * @type int|string $max_depth If greater than 1, comment page will be determined - * for the top-level parent `$comment_ID`. + * for the top-level parent `$comment_id`. * Defaults to the value of the 'thread_comments_depth' option. * } * * @return int|null Comment page number or null on error. */ -function get_page_of_comment( $comment_ID, $args = array() ) { +function get_page_of_comment( $comment_id, $args = array() ) { global $wpdb; $page = null; - $comment = get_comment( $comment_ID ); + $comment = get_comment( $comment_id ); if ( ! $comment ) { return; } @@ -1175,7 +1175,7 @@ function get_page_of_comment( $comment_ID, $args = array() ) { * Filters the calculated page on which a comment appears. * * @since 4.4.0 - * @since 4.7.0 Introduced the `$comment_ID` parameter. + * @since 4.7.0 Introduced the `$comment_id` parameter. * * @param int $page Comment page. * @param array $args { @@ -1196,9 +1196,9 @@ function get_page_of_comment( $comment_ID, $args = array() ) { * @type int $per_page Number of comments per page. * @type int $max_depth Maximum comment threading depth allowed. * } - * @param int $comment_ID ID of the comment. + * @param int $comment_id ID of the comment. */ - return apply_filters( 'get_page_of_comment', (int) $page, $args, $original_args, $comment_ID ); + return apply_filters( 'get_page_of_comment', (int) $page, $args, $original_args, $comment_id ); } /** @@ -1837,7 +1837,7 @@ function wp_transition_comment_status( $new_status, $old_status, $comment ) { * * @since 2.7.0 * - * @param string $comment_ID The comment ID as a numeric string. + * @param string $comment_id The comment ID as a numeric string. * @param WP_Comment $comment Comment object. */ do_action( "comment_{$new_status}_{$comment->comment_type}", $comment->comment_ID, $comment ); @@ -2281,9 +2281,9 @@ function wp_new_comment( $commentdata, $wp_error = false ) { return $commentdata['comment_approved']; } - $comment_ID = wp_insert_comment( $commentdata ); + $comment_id = wp_insert_comment( $commentdata ); - if ( ! $comment_ID ) { + if ( ! $comment_id ) { $fields = array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content' ); foreach ( $fields as $field ) { @@ -2299,8 +2299,8 @@ function wp_new_comment( $commentdata, $wp_error = false ) { return $commentdata['comment_approved']; } - $comment_ID = wp_insert_comment( $commentdata ); - if ( ! $comment_ID ) { + $comment_id = wp_insert_comment( $commentdata ); + if ( ! $comment_id ) { return false; } } @@ -2311,13 +2311,13 @@ function wp_new_comment( $commentdata, $wp_error = false ) { * @since 1.2.0 * @since 4.5.0 The `$commentdata` parameter was added. * - * @param int $comment_ID The comment ID. + * @param int $comment_id The comment ID. * @param int|string $comment_approved 1 if the comment is approved, 0 if not, 'spam' if spam. * @param array $commentdata Comment data. */ - do_action( 'comment_post', $comment_ID, $commentdata['comment_approved'], $commentdata ); + do_action( 'comment_post', $comment_id, $commentdata['comment_approved'], $commentdata ); - return $comment_ID; + return $comment_id; } /** @@ -2325,23 +2325,23 @@ function wp_new_comment( $commentdata, $wp_error = false ) { * * @since 4.4.0 * - * @param int $comment_ID ID of the comment. + * @param int $comment_id ID of the comment. * @return bool True on success, false on failure. */ -function wp_new_comment_notify_moderator( $comment_ID ) { - $comment = get_comment( $comment_ID ); +function wp_new_comment_notify_moderator( $comment_id ) { + $comment = get_comment( $comment_id ); // Only send notifications for pending comments. $maybe_notify = ( '0' == $comment->comment_approved ); /** This filter is documented in wp-includes/comment.php */ - $maybe_notify = apply_filters( 'notify_moderator', $maybe_notify, $comment_ID ); + $maybe_notify = apply_filters( 'notify_moderator', $maybe_notify, $comment_id ); if ( ! $maybe_notify ) { return false; } - return wp_notify_moderator( $comment_ID ); + return wp_notify_moderator( $comment_id ); } /** @@ -2352,11 +2352,11 @@ function wp_new_comment_notify_moderator( $comment_ID ) { * Uses the {@see 'notify_post_author'} filter to determine whether the post author * should be notified when a new comment is added, overriding site setting. * - * @param int $comment_ID Comment ID. + * @param int $comment_id Comment ID. * @return bool True on success, false on failure. */ -function wp_new_comment_notify_postauthor( $comment_ID ) { - $comment = get_comment( $comment_ID ); +function wp_new_comment_notify_postauthor( $comment_id ) { + $comment = get_comment( $comment_id ); $maybe_notify = get_option( 'comments_notify' ); @@ -2367,9 +2367,9 @@ function wp_new_comment_notify_postauthor( $comment_ID ) { * @since 4.4.0 * * @param bool $maybe_notify Whether to notify the post author about the new comment. - * @param int $comment_ID The ID of the comment for the notification. + * @param int $comment_id The ID of the comment for the notification. */ - $maybe_notify = apply_filters( 'notify_post_author', $maybe_notify, $comment_ID ); + $maybe_notify = apply_filters( 'notify_post_author', $maybe_notify, $comment_id ); /* * wp_notify_postauthor() checks if notifying the author of their own comment. @@ -2384,7 +2384,7 @@ function wp_new_comment_notify_postauthor( $comment_ID ) { return false; } - return wp_notify_postauthor( $comment_ID ); + return wp_notify_postauthor( $comment_id ); } /** diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index 280083114c..8faf82eeed 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -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); } /** diff --git a/wp-includes/feed-rss2-comments.php b/wp-includes/feed-rss2-comments.php index bf69a4d3ae..e0e664edaa 100644 --- a/wp-includes/feed-rss2-comments.php +++ b/wp-includes/feed-rss2-comments.php @@ -110,8 +110,8 @@ do_action( 'rss_tag_pre', 'rss2-comments' ); * * @since 2.1.0 * - * @param int $comment_ID The ID of the comment being displayed. - * @param int $ID The ID of the post the comment is connected to. + * @param int $comment_id The ID of the comment being displayed. + * @param int $comment_post_id The ID of the post the comment is connected to. */ do_action( 'commentrss2_item', $comment->comment_ID, $comment_post->ID ); ?> diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index dff61669ed..db8b55acbf 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -1875,7 +1875,7 @@ if ( ! function_exists( 'wp_notify_moderator' ) ) : * @since 4.4.0 * * @param bool $maybe_notify Whether to notify blog moderator. - * @param int $comment_ID The id of the comment for the notification. + * @param int $comment_id The ID of the comment for the notification. */ $maybe_notify = apply_filters( 'notify_moderator', $maybe_notify, $comment_id ); diff --git a/wp-includes/version.php b/wp-includes/version.php index d3bff6203e..d5c09ffec6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.2-beta1-55307'; +$wp_version = '6.2-beta1-55308'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.