| 86 | | $id = max( get_query_var('p'), get_query_var('page_id'), get_query_var('attachment_id')); |
| 87 | | if ( $id && $redirect_url = get_permalink($id) ) |
| 88 | | $redirect['query'] = remove_query_arg(array('p', 'page_id', 'attachment_id'), $redirect['query']); |
| | 86 | $id = max( get_query_var('p'), get_query_var('page_id'), get_query_var('attachment_id') ); |
| | 87 | if ( $id && $redirect_post = get_post($id) ) { |
| | 88 | if ( 'revision' != $redirect_post->post_type ) { // don't attempt to show revisions |
| | 89 | $redirect_url = get_permalink($redirect_post); |
| | 90 | $redirect['query'] = remove_query_arg(array('p', 'page_id', 'attachment_id'), $redirect['query']); |
| | 91 | } |
| | 92 | } |