Make WordPress Core


Ignore:
Timestamp:
05/16/2010 09:24:40 PM (14 years ago)
Author:
westi
Message:

First pass at making the scan for lost attachments custom post type aware. See #10911.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/upload.php

    r14647 r14701  
    2121        wp_die( __('You are not allowed to scan for lost attachments.') );
    2222
    23     $all_posts = implode(',', $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_type IN ('post', 'page')"));
     23    $all_posts = implode( ',', $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_type IN ('" . join("', '", get_post_types() ) . "')"));
    2424    $lost = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_type = 'attachment' AND post_parent > '0' and post_parent NOT IN ($all_posts)");
    25 
     25   
    2626    $_GET['detached'] = 1;
    2727
Note: See TracChangeset for help on using the changeset viewer.