WordPress.org

Make WordPress Core

Ticket #9197: general-template.diff

File general-template.diff, 1.2 KB (added by johnhennmacc, 6 years ago)

Patch as promised

  • Tmp/trunk/wp-includes/general-template.php

     
    10241024        <tr>'; 
    10251025 
    10261026        // Get days with posts 
     1027        $nextmonth=$thismonth+1; 
    10271028        $dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date) 
    1028                 FROM $wpdb->posts WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00' 
     1029                FROM $wpdb->posts WHERE '{$thisyear}-{$nextmonth}-01 00:00:00' >= post_date and post_date >= '{$thisyear}-{$thismonth}-01 00:00:00' 
    10291030                AND post_type = 'post' AND post_status = 'publish' 
    10301031                AND post_date < '" . current_time('mysql') . '\'', ARRAY_N); 
    10311032        if ( $dayswithposts ) { 
     
    10441045        $ak_titles_for_day = array(); 
    10451046        $ak_post_titles = $wpdb->get_results("SELECT post_title, DAYOFMONTH(post_date) as dom " 
    10461047                ."FROM $wpdb->posts " 
    1047                 ."WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00' " 
     1048                ."WHERE '{$thisyear}-{$nextmonth}-01 00:00:00' >= post_date and post_date >= '{$thisyear}-{$thismonth}-01 00:00:00' " 
    10481049                ."AND post_date < '".current_time('mysql')."' " 
    10491050                ."AND post_type = 'post' AND post_status = 'publish'" 
    10501051        );