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
This commit is contained in:
Sergey Biryukov 2024-08-22 23:45:49 +00:00
parent 6e7b1243f3
commit b515d2223a

View File

@ -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;
}