WordPress.org

Make WordPress Core

Ticket #17071: 17071.diff

File 17071.diff, 461 bytes (added by kevinB, 3 years ago)

[updated] filter return value of wp_count_attachments()

  • wp-includes/post.php

     
    18391839        } 
    18401840        $stats['trash'] = $wpdb->get_var( "SELECT COUNT( * ) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status = 'trash' $and"); 
    18411841 
    1842         return (object) $stats; 
     1842        return apply_filters( 'count_attachments', (object) $stats, $mime_type ); 
    18431843} 
    18441844 
    18451845/**