0
如何使用Select2加载Ajax加载选择?如何使用Select2加载选择Ajax?
mycode的:(WordPress的Metabox)
$selectedArtist = get_post_meta($post->ID,'artist_id',true);
if($artists->have_posts()):
echo '<span>Please Select Artist : </span>';
echo '<select name="artist_id[]" class="skant-select" style="width: 90%;" multiple="multiple">';
echo '<option value="0">-- Please Select Artist --</option>';
while ($artists->have_posts()):
$artists->the_post();
echo '<option value="'.$artists->post->ID.'" '.selected(true,in_array($artists->post->ID,$selectedArtist)).' >'.get_the_title().'</option>';
endwhile;
echo '</select>';
wp_reset_postdata();
endif;
在我的wordpress –
无法正常工作,如果你需要帮助,请提供更多信息。什么不行?你尝试了什么?有没有错误?提供代码示例。 – Quagaar