Ticket #59866: 59866-cp.diff
| File 59866-cp.diff, 1.2 KB (added by , 3 years ago) |
|---|
-
src/wp-includes/canonical.php
548 548 $is_attachment_redirect = false; 549 549 550 550 if ( is_attachment() && ! get_option( 'wp_attachment_pages_enabled' ) ) { 551 $attachment_id = get_query_var( 'attachment_id' ); 551 $attachment_id = get_query_var( 'attachment_id' ); 552 $attachment_post = get_post( $attachment_id ); 553 $attachment_parent_id = $attachment_post ? $attachment_post->post_parent : 0; 552 554 553 if ( current_user_can( 'read_post', $attachment_id ) ) { 554 $redirect_url = wp_get_attachment_url( $attachment_id ); 555 // If attachment is attached to a post, attachment page inherits parent post's private status, 556 // so fetch the post to have its private status checked later. 557 if ( $attachment_parent_id ) { 558 $redirect_obj = get_post ( $attachment_parent_id ); 559 } 560 $redirect_url = wp_get_attachment_url( $attachment_id ); 555 561 556 $is_attachment_redirect = true; 557 } 562 $is_attachment_redirect = true; 558 563 } 559 564 560 565 $redirect['query'] = preg_replace( '#^\??&*?#', '', $redirect['query'] );
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)