Changeset 56657 for trunk/src/wp-includes/canonical.php
- Timestamp:
- 09/22/2023 12:02:28 AM (13 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/canonical.php
r56245 r56657 543 543 wp_redirect( $redirect_url, 301 ); 544 544 die(); 545 } 546 } 547 548 $is_attachment_redirect = false; 549 550 if ( is_attachment() && ! get_option( 'wp_attachment_pages_enabled' ) ) { 551 $attachment_id = get_query_var( 'attachment_id' ); 552 553 if ( current_user_can( 'read_post', $attachment_id ) ) { 554 $redirect_url = wp_get_attachment_url( $attachment_id ); 555 556 $is_attachment_redirect = true; 545 557 } 546 558 } … … 651 663 // Trailing slashes. 652 664 if ( is_object( $wp_rewrite ) && $wp_rewrite->using_permalinks() 665 && ! $is_attachment_redirect 653 666 && ! is_404() && ( ! is_front_page() || is_front_page() && get_query_var( 'paged' ) > 1 ) 654 667 ) {
Note: See TracChangeset
for help on using the changeset viewer.