Changeset 34272
- Timestamp:
- 09/17/2015 09:31:21 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/canonical.php
r34213 r34272 151 151 } elseif ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() ) { 152 152 // rewriting of old ?p=X, ?m=2004, ?m=200401, ?m=20040101 153 if ( is_attachment() && !empty($_GET['attachment_id']) && ! $redirect_url ) { 154 if ( $redirect_url = get_attachment_link(get_query_var('attachment_id')) ) 155 $redirect['query'] = remove_query_arg('attachment_id', $redirect['query']); 153 if ( is_attachment() && ! $redirect_url ) { 154 if ( ! empty( $_GET['attachment_id'] ) ) { 155 $redirect_url = get_attachment_link( get_query_var( 'attachment_id' ) ); 156 if ( $redirect_url ) { 157 $redirect['query'] = remove_query_arg( 'attachment_id', $redirect['query'] ); 158 } 159 } else { 160 $redirect_url = get_attachment_link(); 161 } 156 162 } elseif ( is_single() && !empty($_GET['p']) && ! $redirect_url ) { 157 163 if ( $redirect_url = get_permalink(get_query_var('p')) )
Note: See TracChangeset
for help on using the changeset viewer.