mirror of
git://develop.git.wordpress.org/
synced 2025-01-16 20:38:35 +01:00
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:
parent
6e7b1243f3
commit
b515d2223a
@ -553,16 +553,17 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
|
|||||||
$attachment_id = get_query_var( 'attachment_id' );
|
$attachment_id = get_query_var( 'attachment_id' );
|
||||||
$attachment_post = get_post( $attachment_id );
|
$attachment_post = get_post( $attachment_id );
|
||||||
$attachment_parent_id = $attachment_post ? $attachment_post->post_parent : 0;
|
$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 ( $attachment_url !== $redirect_url ) {
|
||||||
/*
|
/*
|
||||||
* If an attachment is attached to a post, it inherits the parent post's status. Fetch the
|
* If an attachment is attached to a post, it inherits the parent post's status.
|
||||||
* parent post to check its status later.
|
* Fetch the parent post to check its status later.
|
||||||
*/
|
*/
|
||||||
if ( $attachment_parent_id ) {
|
if ( $attachment_parent_id ) {
|
||||||
$redirect_obj = get_post( $attachment_parent_id );
|
$redirect_obj = get_post( $attachment_parent_id );
|
||||||
}
|
}
|
||||||
|
|
||||||
$redirect_url = $attachment_url;
|
$redirect_url = $attachment_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user