WordPress.org

Make WordPress Core

Changeset 36280


Ignore:
Timestamp:
01/13/2016 08:19:48 AM (4 years ago)
Author:
dd32
Message:

Canonical / Query: Restore the is_404() check in wp_old_slug_redirect() which was removed in [34659].
This reverts part of [34659] due to excessive canonical problems it's caused in 4.4.x.

Fixes #35344, #21602 for the 4.4 branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.4/src/wp-includes/query.php

    r36129 r36280  
    49824982 * @global WP_Query   $wp_query   Global WP_Query instance.
    49834983 * @global wpdb       $wpdb       WordPress database abstraction object.
    4984  * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
    49854984 */
    49864985function wp_old_slug_redirect() {
    4987     global $wp_query, $wp_rewrite;
    4988 
    4989     if ( get_queried_object() ) {
    4990         return;
    4991     }
    4992 
    4993     if ( '' !== $wp_query->query_vars['name'] ) :
     4986    global $wp_query;
     4987
     4988    if ( is_404() && '' !== $wp_query->query_vars['name'] ) :
    49944989        global $wpdb;
    49954990
     
    50395034        } elseif( is_embed() ) {
    50405035            $link = user_trailingslashit( trailingslashit( $link ) . 'embed' );
    5041         } elseif ( is_404() ) {
    5042             // Add rewrite endpoints if necessary.
    5043             foreach ( $wp_rewrite->endpoints as $endpoint ) {
    5044                 if ( $endpoint[2] && false !== get_query_var( $endpoint[2], false ) ) {
    5045                     $link = user_trailingslashit( trailingslashit( $link ) . $endpoint[1] );
    5046                 }
    5047             }
    50485036        }
    50495037
Note: See TracChangeset for help on using the changeset viewer.