Make WordPress Core

Ticket #43056: 43056.3.diff

File 43056.3.diff, 865 bytes (added by junaidbhura, 6 years ago)
  • src/wp-includes/canonical.php

    diff --git a/src/wp-includes/canonical.php b/src/wp-includes/canonical.php
    index 5a63de3481..08bb08a617 100644
    a b function redirect_guess_404_permalink() { 
    897897
    898898                // If any of post_type, year, monthnum, or day are set, use them to refine the query.
    899899                if ( get_query_var( 'post_type' ) ) {
    900                         $where .= $wpdb->prepare( ' AND post_type = %s', get_query_var( 'post_type' ) );
     900                        if ( is_array( get_query_var( 'post_type' ) ) ) {
     901                                $where .= $wpdb->prepare( ' AND post_type IN (%s)', implode( ',', esc_sql( get_query_var( 'post_type' ) ) ) );
     902                        } else {
     903                                $where .= $wpdb->prepare( ' AND post_type = %s', get_query_var( 'post_type' ) );
     904                        }
    901905                } else {
    902906                        $where .= " AND post_type IN ('" . implode( "', '", get_post_types( array( 'public' => true ) ) ) . "')";
    903907                }