WordPress.org

Make WordPress Core

Ticket #17023: media-upload-month-year_filter_3.2.patch

File media-upload-month-year_filter_3.2.patch, 692 bytes (added by kevinB, 4 years ago)

query filter for month/year query in media_upload_library_form()

  • wp-admin/includes/media.php

     
    19851985<div class="alignleft actions"> 
    19861986<?php 
    19871987 
    1988 $arc_query = "SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'attachment' ORDER BY post_date DESC"; 
     1988$arc_query = apply_filters( 'media_upload_year_month_query', "SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'attachment' ORDER BY post_date DESC" ); 
    19891989 
    19901990$arc_result = $wpdb->get_results( $arc_query );