Support » Fixing WordPress » Doubled thumbnails in uploads

Viewing 1 replies (of 1 total)
  • This looks, to me, to be a problem down in upload-functions.php, in the wp_upload_tab_browse() function. It appears to get double attachment entries for any given post.

    Tracing the SQL executed:
    SELECT SQL_CALC_FOUND_ROWS posts.* FROM posts LEFT JOIN postmeta ON posts.ID = postmeta.post_id WHERE 1=1 AND (post_type = ‘attachment’) ORDER BY post_date DESC LIMIT 30, 10

    returns double entries for each post, and thus generates a doubled count for the next query that gets executed (the found_rows() query).

    If I mod the loop in that function, so that it keeps track of the last ID it saw:

    if ( have_posts() ) : while ( have_posts() ) : the_post();
    if (get_the_ID() == $last_id) { continue; }
    $last_id = get_the_ID();

    the output to the browser is what I expect. However, I can’t believe that WordPress is this borked, so it’s got to be something in my setup.

Viewing 1 replies (of 1 total)
  • The topic ‘Doubled thumbnails in uploads’ is closed to new replies.