你需要获得CPT (Custom Post Type
) A
, 然后在第二个循环CPT 在CPT的元数据库中B
.示例:
$my_titles = array(
\'post_status\' => \'publish\',
\'posts_per_page\' => -1,
\'order\' => \'ASC\',
\'post_type\' => \'my_custom_post_type\' // get the type of your CPT
);
现在在您的第二个自定义帖子类型中,即
B
, 内部
meta box
像这样循环
<select name="" id="">
<?php foreach ($my_titles as $key => $title): ?>
<option value=""><?php echo $title; ?></option>
<?php endforeach ?>
</select>