请看一下下面的循环,我在尝试按标题、名称和修改顺序排列附件时遇到了问题。
<?php
foreach ($instance[\'data\'] as $id) :
$args = array(
\'include\' => $id,
\'post_type\' => \'attachment\',
\'posts_per_page\' => -1,
\'post_status\' => \'any\',
\'orderby\' => \'title\',
\'order\' => \'DESC\',
);
$data_attach = get_posts($args);
foreach ($data_attach as $data) :
?>
<?php print_r($data->ID);?>
<?php
endforeach;
endforeach;
?>
打印\\R
print\\u r($实例[\'data]);
Array ( [0] => 1686 [1] => 1628 [2] => 1027 [3] => 1022 [4] => 1045 [5] => 1029 )
打印(数据->ID);
1686 1628 1027 1022 1045 1029