Make WordPress Core

Changeset 57530


Ignore:
Timestamp:
02/04/2024 06:44:02 PM (6 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

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

    r56747 r57530  
    31753175 * @param string $title         Title of post.
    31763176 * @param string $excerpt       Excerpt of post.
    3177  * @param int    $ID            Post ID.
     3177 * @param int    $post_id       Post ID.
    31783178 * @return int|false|void Database query from update.
    31793179 */
    3180 function trackback( $trackback_url, $title, $excerpt, $ID ) {
     3180function trackback( $trackback_url, $title, $excerpt, $post_id ) {
    31813181    global $wpdb;
    31823182
     
    31893189    $options['body']    = array(
    31903190        'title'     => $title,
    3191         'url'       => get_permalink( $ID ),
     3191        'url'       => get_permalink( $post_id ),
    31923192        'blog_name' => get_option( 'blogname' ),
    31933193        'excerpt'   => $excerpt,
     
    32003200    }
    32013201
    3202     $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET pinged = CONCAT(pinged, '\n', %s) WHERE ID = %d", $trackback_url, $ID ) );
    3203     return $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, %s, '')) WHERE ID = %d", $trackback_url, $ID ) );
     3202    $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET pinged = CONCAT(pinged, '\n', %s) WHERE ID = %d", $trackback_url, $post_id ) );
     3203    return $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, %s, '')) WHERE ID = %d", $trackback_url, $post_id ) );
    32043204}
    32053205
Note: See TracChangeset for help on using the changeset viewer.