3258 | | $has_audio = $wpdb->get_var( " |
3259 | | SELECT ID |
3260 | | FROM $wpdb->posts |
3261 | | WHERE post_type = 'attachment' |
3262 | | AND post_mime_type LIKE 'audio%' |
3263 | | LIMIT 1 |
3264 | | " ); |
3265 | | $has_video = $wpdb->get_var( " |
3266 | | SELECT ID |
3267 | | FROM $wpdb->posts |
3268 | | WHERE post_type = 'attachment' |
3269 | | AND post_mime_type LIKE 'video%' |
3270 | | LIMIT 1 |
3271 | | " ); |
3272 | | $months = $wpdb->get_results( $wpdb->prepare( " |
3273 | | SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month |
3274 | | FROM $wpdb->posts |
3275 | | WHERE post_type = %s |
3276 | | ORDER BY post_date DESC |
3277 | | ", 'attachment' ) ); |
| 3258 | $has_audio = apply_filters('media_has_audio', false ); |
| 3259 | if ( empty ( $has_audio ) ){ |
| 3260 | $has_audio = $wpdb->get_var( " |
| 3261 | SELECT ID |
| 3262 | FROM $wpdb->posts |
| 3263 | WHERE post_type = 'attachment' |
| 3264 | AND post_mime_type LIKE 'audio%' |
| 3265 | LIMIT 1 |
| 3266 | " ); |
| 3267 | } |
| 3268 | $has_video = apply_filters('media_has video', false ); |
| 3269 | if ( empty ( $has_video ) ) { |
| 3270 | $has_video = $wpdb->get_var( " |
| 3271 | SELECT ID |
| 3272 | FROM $wpdb->posts |
| 3273 | WHERE post_type = 'attachment' |
| 3274 | AND post_mime_type LIKE 'video%' |
| 3275 | LIMIT 1 |
| 3276 | " ); |
| 3277 | } |
| 3278 | $months = apply_filters('media_months', false ); |
| 3279 | if ( empty ( $months ) ){ |
| 3280 | $months = $wpdb->get_results( $wpdb->prepare( " |
| 3281 | SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month |
| 3282 | FROM $wpdb->posts |
| 3283 | WHERE post_type = %s |
| 3284 | ORDER BY post_date DESC |
| 3285 | ", 'attachment' ) ); |
| 3286 | } |