From 629d4c5753f5ab911182b80408f545cb073bfbc7 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 4 Feb 2024 18:44:02 +0000 Subject: [PATCH] Coding Standards: Rename the `$ID` parameter to `$post_id` in `trackback()`. This resolves a few WPCS warnings: {{{ Variable "$ID" is not in valid snake_case format, try "$i_d" }}} See #59650. git-svn-id: https://develop.svn.wordpress.org/trunk@57530 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/comment.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php index de23a72130..37d36364ce 100644 --- a/src/wp-includes/comment.php +++ b/src/wp-includes/comment.php @@ -3174,10 +3174,10 @@ function privacy_ping_filter( $sites ) { * @param string $trackback_url URL to send trackbacks. * @param string $title Title of post. * @param string $excerpt Excerpt of post. - * @param int $ID Post ID. + * @param int $post_id Post ID. * @return int|false|void Database query from update. */ -function trackback( $trackback_url, $title, $excerpt, $ID ) { +function trackback( $trackback_url, $title, $excerpt, $post_id ) { global $wpdb; if ( empty( $trackback_url ) ) { @@ -3188,7 +3188,7 @@ function trackback( $trackback_url, $title, $excerpt, $ID ) { $options['timeout'] = 10; $options['body'] = array( 'title' => $title, - 'url' => get_permalink( $ID ), + 'url' => get_permalink( $post_id ), 'blog_name' => get_option( 'blogname' ), 'excerpt' => $excerpt, ); @@ -3199,8 +3199,8 @@ function trackback( $trackback_url, $title, $excerpt, $ID ) { return; } - $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET pinged = CONCAT(pinged, '\n', %s) WHERE ID = %d", $trackback_url, $ID ) ); - return $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, %s, '')) WHERE ID = %d", $trackback_url, $ID ) ); + $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET pinged = CONCAT(pinged, '\n', %s) WHERE ID = %d", $trackback_url, $post_id ) ); + return $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, %s, '')) WHERE ID = %d", $trackback_url, $post_id ) ); } /**