WordPress.org

Make WordPress Core

Ticket #43056: 43056.diff

File 43056.diff, 853 bytes (added by junaidbhura, 16 months ago)
  • src/wp-includes/canonical.php

    diff --git a/src/wp-includes/canonical.php b/src/wp-includes/canonical.php
    index ad219c2711..ac53cfc617 100644
    a b function redirect_guess_404_permalink() { 
    663663
    664664                // if any of post_type, year, monthnum, or day are set, use them to refine the query
    665665                if ( get_query_var( 'post_type' ) ) {
    666                         $where .= $wpdb->prepare( ' AND post_type = %s', get_query_var( 'post_type' ) );
     666                        if ( is_array( get_query_var( 'post_type' ) ) ) {
     667                                $where .= $wpdb->prepare( ' AND post_type IN (%s)', implode( ',', get_query_var( 'post_type' ) ) );
     668                        } else {
     669                                $where .= $wpdb->prepare( ' AND post_type = %s', get_query_var( 'post_type' ) );
     670                        }
    667671                } else {
    668672                        $where .= " AND post_type IN ('" . implode( "', '", get_post_types( array( 'public' => true ) ) ) . "')";
    669673                }