'; // Just query for the IDs only to reduce memory usage $images = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type = 'attachment' AND post_mime_type LIKE 'image/%'" ); if ( empty($images) ) { echo '

' . sprintf( __( "Unable to find any images. Are you sure some exist?", 'arras' ), admin_url('upload.php?post_mime_type=image') ) . "

\n\n"; } else { echo '

' . __( "Please be patient while all thumbnails are regenerated. This can take a while if your server is slow (cheap hosting) or if you have many images. Do not navigate away from this page until this script is done or all thumbnails won't be resized. You will be notified via this page when all regenerating is completed.", 'arras' ) . '

'; // Generate the list of IDs $ids = array(); foreach ( $images as $image ) $ids[] = $image->ID; $ids = implode( ',', $ids ); $count = count($images); ?>