Make WordPress Core


Ignore:
Timestamp:
07/19/2022 02:00:35 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Improve variable names in wp-trackback.php.

This fixes a Variable "$comment_post_ID" is not in valid snake_case format WPCS warning.

$comment_post_ID, while matching the database field of the same name, does not follow the WordPress coding standards, so the variable is now renamed to $comment_post_id.

Additionally, these variables are renamed for clarity:

  • $tb_id to $post_id (this was not the trackback ID)
  • $tb_url to $trackback_url

Follow-up to [172], [637], [1616],

See #55647, #56244.

File:
1 edited

Legend:

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

    r53715 r53719  
    11471147function get_trackback_url() {
    11481148    if ( get_option( 'permalink_structure' ) ) {
    1149         $tb_url = trailingslashit( get_permalink() ) . user_trailingslashit( 'trackback', 'single_trackback' );
     1149        $trackback_url = trailingslashit( get_permalink() ) . user_trailingslashit( 'trackback', 'single_trackback' );
    11501150    } else {
    1151         $tb_url = get_option( 'siteurl' ) . '/wp-trackback.php?p=' . get_the_ID();
     1151        $trackback_url = get_option( 'siteurl' ) . '/wp-trackback.php?p=' . get_the_ID();
    11521152    }
    11531153
     
    11571157     * @since 2.2.0
    11581158     *
    1159      * @param string $tb_url The trackback URL.
    1160      */
    1161     return apply_filters( 'trackback_url', $tb_url );
     1159     * @param string $trackback_url The trackback URL.
     1160     */
     1161    return apply_filters( 'trackback_url', $trackback_url );
    11621162}
    11631163
Note: See TracChangeset for help on using the changeset viewer.