WordPress.org

Make WordPress Core

Ticket #19693: 19693.3.diff

File 19693.3.diff, 705 bytes (added by jeremyfelt, 3 years ago)
  • wp-includes/canonical.php

     
    493493                if ( get_query_var('post_type') ) 
    494494                        $where .= $wpdb->prepare(" AND post_type = %s", get_query_var('post_type')); 
    495495                else 
    496                         $where .= " AND post_type IN ('" . implode( "', '", get_post_types( array( 'public' => true ) ) ) . "')"; 
     496                        $where .= " AND post_type IN ('" . implode( "', '", get_post_types( array( 'public' => true, 'publicly_queryable' => true ) ) ) . "')"; 
    497497 
    498498                if ( get_query_var('year') ) 
    499499                        $where .= $wpdb->prepare(" AND YEAR(post_date) = %d", get_query_var('year'));