|
@@ 166-169 (lines=4) @@
|
| 163 |
|
} else { |
| 164 |
|
$redirect_url = get_attachment_link(); |
| 165 |
|
} |
| 166 |
|
} elseif ( is_single() && !empty($_GET['p']) && ! $redirect_url ) { |
| 167 |
|
if ( $redirect_url = get_permalink(get_query_var('p')) ) |
| 168 |
|
$redirect['query'] = remove_query_arg(array('p', 'post_type'), $redirect['query']); |
| 169 |
|
} elseif ( is_single() && !empty($_GET['name']) && ! $redirect_url ) { |
| 170 |
|
if ( $redirect_url = get_permalink( $wp_query->get_queried_object_id() ) ) |
| 171 |
|
$redirect['query'] = remove_query_arg('name', $redirect['query']); |
| 172 |
|
} elseif ( is_page() && !empty($_GET['page_id']) && ! $redirect_url ) { |
|
@@ 172-175 (lines=4) @@
|
| 169 |
|
} elseif ( is_single() && !empty($_GET['name']) && ! $redirect_url ) { |
| 170 |
|
if ( $redirect_url = get_permalink( $wp_query->get_queried_object_id() ) ) |
| 171 |
|
$redirect['query'] = remove_query_arg('name', $redirect['query']); |
| 172 |
|
} elseif ( is_page() && !empty($_GET['page_id']) && ! $redirect_url ) { |
| 173 |
|
if ( $redirect_url = get_permalink(get_query_var('page_id')) ) |
| 174 |
|
$redirect['query'] = remove_query_arg('page_id', $redirect['query']); |
| 175 |
|
} elseif ( is_page() && !is_feed() && 'page' == get_option('show_on_front') && get_queried_object_id() == get_option('page_on_front') && ! $redirect_url ) { |
| 176 |
|
$redirect_url = home_url('/'); |
| 177 |
|
} elseif ( is_home() && !empty($_GET['page_id']) && 'page' == get_option('show_on_front') && get_query_var('page_id') == get_option('page_for_posts') && ! $redirect_url ) { |
| 178 |
|
if ( $redirect_url = get_permalink(get_option('page_for_posts')) ) |
|
@@ 202-205 (lines=4) @@
|
| 199 |
|
} elseif ( is_month() && get_query_var('year') && !empty($_GET['monthnum']) ) { |
| 200 |
|
if ( $redirect_url = get_month_link(get_query_var('year'), get_query_var('monthnum')) ) |
| 201 |
|
$redirect['query'] = remove_query_arg(array('year', 'monthnum'), $redirect['query']); |
| 202 |
|
} elseif ( is_year() && !empty($_GET['year']) ) { |
| 203 |
|
if ( $redirect_url = get_year_link(get_query_var('year')) ) |
| 204 |
|
$redirect['query'] = remove_query_arg('year', $redirect['query']); |
| 205 |
|
} elseif ( is_author() && !empty($_GET['author']) && preg_match( '|^[0-9]+$|', $_GET['author'] ) ) { |
| 206 |
|
$author = get_userdata(get_query_var('author')); |
| 207 |
|
if ( ( false !== $author ) && $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE $wpdb->posts.post_author = %d AND $wpdb->posts.post_status = 'publish' LIMIT 1", $author->ID ) ) ) { |
| 208 |
|
if ( $redirect_url = get_author_posts_url($author->ID, $author->user_nicename) ) |