WordPress.org

Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r35690 r36354  
    23012301            }
    23022302
    2303             $search_orderby = '(CASE ';
     2303            $search_orderby = '';
    23042304
    23052305            // sentence match in 'post_title'
     
    23222322                $search_orderby .= $wpdb->prepare( "WHEN $wpdb->posts.post_content LIKE %s THEN 4 ", $like );
    23232323            }
    2324             $search_orderby .= 'ELSE 5 END)';
     2324
     2325            if ( $search_orderby ) {
     2326                $search_orderby = '(CASE ' . $search_orderby . 'ELSE 5 END)';
     2327            }
    23252328        } else {
    23262329            // single word or sentence search
     
    49824985 * @global WP_Query   $wp_query   Global WP_Query instance.
    49834986 * @global wpdb       $wpdb       WordPress database abstraction object.
    4984  * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
    49854987 */
    49864988function wp_old_slug_redirect() {
    4987     global $wp_query, $wp_rewrite;
    4988 
    4989     if ( '' !== $wp_query->query_vars['name'] ) :
     4989    global $wp_query;
     4990
     4991    if ( is_404() && '' !== $wp_query->query_vars['name'] ) :
    49904992        global $wpdb;
    49914993
     
    50295031        $link = get_permalink( $id );
    50305032
    5031         if ( is_feed() ) {
    5032             $link = user_trailingslashit( trailingslashit( $link ) . 'feed' );
    5033         } elseif ( isset( $GLOBALS['wp_query']->query_vars['paged'] ) && $GLOBALS['wp_query']->query_vars['paged'] > 1 ) {
     5033        if ( isset( $GLOBALS['wp_query']->query_vars['paged'] ) && $GLOBALS['wp_query']->query_vars['paged'] > 1 ) {
    50345034            $link = user_trailingslashit( trailingslashit( $link ) . 'page/' . $GLOBALS['wp_query']->query_vars['paged'] );
    50355035        } elseif( is_embed() ) {
    50365036            $link = user_trailingslashit( trailingslashit( $link ) . 'embed' );
    5037         } elseif ( is_404() ) {
    5038             // Add rewrite endpoints if necessary.
    5039             foreach ( $wp_rewrite->endpoints as $endpoint ) {
    5040                 if ( $endpoint[2] && false !== get_query_var( $endpoint[2], false ) ) {
    5041                     $link = user_trailingslashit( trailingslashit( $link ) . $endpoint[1] );
    5042                 }
    5043             }
    50445037        }
    50455038
Note: See TracChangeset for help on using the changeset viewer.