WordPress.org

Make WordPress Core

Ticket #9860: postbypost_filters_clean_2.8.patch

File postbypost_filters_clean_2.8.patch, 774 bytes (added by kevinB, 5 years ago)

CORRECTED: getarchives_distinct, getarchives_fields filters for postbypost archive type

  • general-template.php

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