Changeset 48166 for trunk/src/wp-includes/canonical.php
- Timestamp:
- 06/25/2020 11:39:23 AM (5 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/canonical.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/canonical.php
r48153 r48166 58 58 } 59 59 60 if ( is_admin() || is_search() || is_preview() || is_trackback() 61 || is_favicon() ||( $is_IIS && ! iis7_supports_permalinks() )60 if ( is_admin() || is_search() || is_preview() || is_trackback() || is_favicon() 61 || ( $is_IIS && ! iis7_supports_permalinks() ) 62 62 ) { 63 63 return; … … 656 656 } 657 657 658 // Remove trailing slash for sitemaps requests. 659 if ( ! empty( get_query_var( 'sitemap' ) ) || ! empty( get_query_var( 'sitemap-stylesheet' ) ) ) { 658 // Remove trailing slash for robots.txt or sitemap requests. 659 if ( is_robots() 660 || ! empty( get_query_var( 'sitemap' ) ) || ! empty( get_query_var( 'sitemap-stylesheet' ) ) 661 ) { 660 662 $redirect['path'] = untrailingslashit( $redirect['path'] ); 661 663 } … … 681 683 ) { 682 684 $redirect['host'] = $original['host']; 683 }684 685 // Even if the permalink structure ends with a slash, remove slash robots.txt.686 if ( is_robots() ) {687 $redirect['path'] = untrailingslashit( $redirect['path'] );688 685 } 689 686
Note: See TracChangeset
for help on using the changeset viewer.