Ticket #9860: postbypost_filters_clean_2.9.patch

File postbypost_filters_clean_2.9.patch, 772 bytes (added by kevinB, 4 years ago)

UPDATE for 2.9: getarchives_distinct, getarchives_fields filters for postbypost archive type

  • general-template.php

     
    898898                } 
    899899        } elseif ( ( 'postbypost' == $type ) || ('alpha' == $type) ) { 
    900900                $orderby = ('alpha' == $type) ? "post_title ASC " : "post_date DESC "; 
    901                 $query = "SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit"; 
     901 
     902                $distinct = apply_filters('getarchives_distinct', "", $r);  
     903                $fields = apply_filters('getarchives_fields', "*", $r);  
     904 
     905                $query = "SELECT $distinct $fields FROM $wpdb->posts $join $where ORDER BY $orderby $limit";  
     906 
    902907                $key = md5($query); 
    903908                $cache = wp_cache_get( 'wp_get_archives' , 'general'); 
    904909                if ( !isset( $cache[ $key ] ) ) {