WordPress.org

Make WordPress Core

Ticket #12601: 12601.diff

File 12601.diff, 622 bytes (added by dd32, 5 years ago)
  • canonical.php

     
    369369                $where .= $wpdb->prepare(" AND MONTH(post_date) = %d", get_query_var('monthnum')); 
    370370        if ( get_query_var('day') ) 
    371371                $where .= $wpdb->prepare(" AND DAYOFMONTH(post_date) = %d", get_query_var('day')); 
     372        if ( get_query_var('post_type') ) 
     373                $where .= $wpdb->prepare(" AND post_type = %s", get_query_var('post_type')); 
    372374 
    373375        $post_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE $where AND post_status = 'publish'"); 
    374376        if ( !$post_id )