diff --git a/src/wp-includes/canonical.php b/src/wp-includes/canonical.php
index 557e36acd9..2a3f9c27e1 100644
|
a
|
b
|
function redirect_guess_404_permalink() { |
| 704 | 704 | $where .= $wpdb->prepare( ' AND DAYOFMONTH(post_date) = %d', get_query_var( 'day' ) ); |
| 705 | 705 | } |
| 706 | 706 | |
| 707 | | $post_id = $wpdb->get_var( "SELECT ID FROM $wpdb->posts WHERE $where AND post_status = 'publish'" ); |
| | 707 | $post_id = $wpdb->get_var( "SELECT ID FROM $wpdb->posts WHERE $where AND post_status IN ('" . implode( "', '", get_post_stati( array( 'public' => true ) ) ) . "')" ); |
| 708 | 708 | if ( ! $post_id ) { |
| 709 | 709 | return false; |
| 710 | 710 | } |