我在管理区域的内容类型“团队”中创建了一个 meta_box,允许用户选中他们想要与他们正在创建的内容相关联的任何标题旁边的框。标题正在循环播放,它们来自不同的内容类型。
array(
'name' => __('Player List', 'theme_name'),
'desc' => 'Select all the players that are on the team you are creating.',
'id' => 'theme_name_players_completelist',
'type' => 'checkbox',
'options' => array(
$args = array( 'post_type' => 'players');
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
array('name' => __(the_title(), 'theme_name'), 'value' => 'get_the_ID()'),
//But here is where I need to loop through and show the titles of the content type called team_members. The value could be the post ID or Title or whatever I guess.
endwhile;
)
),
这是实现这一目标的唯一方法吗?