How can I load Ajax Load Select With Select2?
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;