我正在尝试创建一个project_attachment_pathresources :projects do get "attachments/:id:format" => "attachments#download", :as => :attachmentendattachment_projects GET
我发现数据库中没有_wp_attachment_metadata,因为这些图片缺少缩略图。然而,这些文件存在于磁盘上--包括原始文件和“裁剪”大小。{ global $wpdb; $sql = " select ID from {$wpdb->posts} where post_type = 'attachment' "; $images = $wpdb->get_col($sql); foreach ($images as $id