Skip to content

Commit

Permalink
Docs: Correct inline comment formatting in redirect_canonical().
Browse files Browse the repository at this point in the history
Follow-up to [57357].

See #61608.

git-svn-id: https://develop.svn.wordpress.org/trunk@58924 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Aug 22, 2024
1 parent 6e7b124 commit b515d22
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/wp-includes/canonical.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit b515d22

Please sign in to comment.