From b515d2223a24cba7990dfeda31fbf2d2e8f62ceb Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 22 Aug 2024 23:45:49 +0000 Subject: [PATCH] Docs: Correct inline comment formatting in `redirect_canonical()`. Follow-up to [57357]. See #61608. git-svn-id: https://develop.svn.wordpress.org/trunk@58924 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/canonical.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/canonical.php b/src/wp-includes/canonical.php index 849e15ac76dcf..58723ebc0d8a4 100644 --- a/src/wp-includes/canonical.php +++ b/src/wp-includes/canonical.php @@ -553,16 +553,17 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) { $attachment_id = get_query_var( 'attachment_id' ); $attachment_post = get_post( $attachment_id ); $attachment_parent_id = $attachment_post ? $attachment_post->post_parent : 0; + $attachment_url = wp_get_attachment_url( $attachment_id ); - $attachment_url = wp_get_attachment_url( $attachment_id ); if ( $attachment_url !== $redirect_url ) { /* - * If an attachment is attached to a post, it inherits the parent post's status. Fetch the - * parent post to check its status later. - */ + * If an attachment is attached to a post, it inherits the parent post's status. + * Fetch the parent post to check its status later. + */ if ( $attachment_parent_id ) { $redirect_obj = get_post( $attachment_parent_id ); } + $redirect_url = $attachment_url; }