WordPress.org

Make WordPress Core

Ticket #12448: 12448.diff

File 12448.diff, 697 bytes (added by PeteMall, 4 years ago)
  • wp-admin/upload.php

     
    146146                $orphans = $wpdb->get_results( $wpdb->prepare( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1 LIMIT %d, %d", $start, $media_per_page ) ); 
    147147                $total_orphans = $wpdb->get_var( "SELECT FOUND_ROWS()" ); 
    148148                $page_links_total = ceil( $total_orphans / $media_per_page ); 
     149                $wp_query->found_posts = $total_orphans; 
     150                $wp_query->query_vars['posts_per_page'] = $media_per_page; 
    149151        } 
    150152 
    151153        $post_mime_types = get_post_mime_types();