$media_query = new WP_Query(
array(
\'post_type\' => \'attachment\',
\'post_status\' => \'inherit\',
\'posts_per_page\' => -1,
)
);
$list = array();
foreach ($media_query->posts as $post) {
$list[] = wp_get_attachment_url($post->ID);
}
// do something with $list here;
查询数据库中的所有媒体库项目(不仅仅是附在帖子上的项目),获取它们的url,将它们全部转储到
$list
大堆