按标记筛选帖子附件时出现问题。。。它工作得很好,直到我在arg中添加了tag\\uu(以及它的其他变体)。
$vidArgs = array(
\'tag__in\' =>5,
\'post_type\' => \'attachment\',
\'post_parent\' => $post->ID,
\'post_mime_type\'=>\'video/quicktime\',
\'posts_per_page\'=>20
);
$videos = get_posts($vidArgs);
foreach ($videos as $vid) { ///....
感谢您的指点/建议!UPDATES这很奇怪。它只是不适用于媒体标签!将testtag添加到帖子中,它就会出现。必须有一种方法通过标签获取附件?否则有什么意义?该功能位于媒体标签窗格的wp admin中。。。
$argsc = array(
/* \'tag\' => \'commercials,testtag\', */
\'tag__in\' => array(5,11),
\'post_type\'=>array(\'post\',\'page\',\'attachment\'),
\'post_status\'=>\'any\',
/* \'post_parent\'=>$post->ID, */
\'posts_per_page\'=>20
);
$the_queryB = get_posts( $argsc);
echo count($the_queryB).", <pre>";
print_r($the_queryB);