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.

git-svn-id: https://develop.svn.wordpress.org/trunk@53719 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2022-07-19 14:00:35 +00:00
parent 41475f336e
commit b49a83cb4c
2 changed files with 44 additions and 25 deletions
+4 -4
View File
@@ -1146,9 +1146,9 @@ function comment_type( $commenttxt = false, $trackbacktxt = false, $pingbacktxt
*/
function get_trackback_url() {
if ( get_option( 'permalink_structure' ) ) {
$tb_url = trailingslashit( get_permalink() ) . user_trailingslashit( 'trackback', 'single_trackback' );
$trackback_url = trailingslashit( get_permalink() ) . user_trailingslashit( 'trackback', 'single_trackback' );
} else {
$tb_url = get_option( 'siteurl' ) . '/wp-trackback.php?p=' . get_the_ID();
$trackback_url = get_option( 'siteurl' ) . '/wp-trackback.php?p=' . get_the_ID();
}
/**
@@ -1156,9 +1156,9 @@ function get_trackback_url() {
*
* @since 2.2.0
*
* @param string $tb_url The trackback URL.
* @param string $trackback_url The trackback URL.
*/
return apply_filters( 'trackback_url', $tb_url );
return apply_filters( 'trackback_url', $trackback_url );
}
/**