我使用此查询返回页面的附件。
$args = array(
\'post_parent\' => $post->ID,
\'post_status\' => \'inherit\',
\'post_type\' => \'attachment\'
);
是否有方法对此进行调整,以便返回当前页面的附件和所有子页面的附件?我使用此查询返回页面的附件。
$args = array(
\'post_parent\' => $post->ID,
\'post_status\' => \'inherit\',
\'post_type\' => \'attachment\'
);
是否有方法对此进行调整,以便返回当前页面的附件和所有子页面的附件?posts查询本质上不是递归的。我不这么认为post_parent
接受多个ID,因此您可能需要在多个页面中循环并运行此ID,或者使用查询过滤器以在较少的请求中完成此操作(如果性能成为问题)。
在将例如文件附加到帖子时,如何在事后编辑/删除它们?在帖子编辑器中找不到任何内容。谢谢