Coding Standards: Remove unnecessary conditional from do_trackbacks().

The check for a truthy `$to_ping` value is redundant, as a falsey value would cause the function to return early a few lines above.

Follow-up to [1794], [2612].

Props justlevine.
See #63268.
Built from https://develop.svn.wordpress.org/trunk@60406


git-svn-id: http://core.svn.wordpress.org/trunk@59742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2025-07-02 16:44:31 +00:00
parent b21189e96f
commit cadbf4a842
2 changed files with 14 additions and 17 deletions

View File

@@ -3060,22 +3060,19 @@ function do_trackbacks( $post ) {
$post_title = apply_filters( 'the_title', $post->post_title, $post->ID );
$post_title = strip_tags( $post_title );
if ( $to_ping ) {
foreach ( (array) $to_ping as $tb_ping ) {
$tb_ping = trim( $tb_ping );
if ( ! in_array( $tb_ping, $pinged, true ) ) {
trackback( $tb_ping, $post_title, $excerpt, $post->ID );
$pinged[] = $tb_ping;
} else {
$wpdb->query(
$wpdb->prepare(
"UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, %s,
'')) WHERE ID = %d",
$tb_ping,
$post->ID
)
);
}
foreach ( (array) $to_ping as $tb_ping ) {
$tb_ping = trim( $tb_ping );
if ( ! in_array( $tb_ping, $pinged, true ) ) {
trackback( $tb_ping, $post_title, $excerpt, $post->ID );
$pinged[] = $tb_ping;
} else {
$wpdb->query(
$wpdb->prepare(
"UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, %s, '')) WHERE ID = %d",
$tb_ping,
$post->ID
)
);
}
}
}

View File

@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.9-alpha-60405';
$wp_version = '6.9-alpha-60406';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.