Skip to content

Commit

Permalink
Coding Standards: Rename the $ID parameter to $post_id in `trackb…
Browse files Browse the repository at this point in the history
…ack()`.

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
  • Loading branch information
SergeyBiryukov committed Feb 4, 2024
1 parent 7d9eb8f commit 629d4c5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/wp-includes/comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) ) {
Expand All @@ -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,
);
Expand All @@ -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 ) );
}

/**
Expand Down

0 comments on commit 629d4c5

Please sign in to comment.