-1
如何保存選擇下拉wordpress metaboxes?如何保存選擇下拉wordpress metaboxes
在選項中有一個來自我的自定義文章類型的循環。
<select name="music[artists]" class="skant-select" id="artists" style="width: 90%;" multiple="multiple">
<?php
$artists_meta_box_args = array(
'post_type' => array('music_artist'),
//'posts_per_page' => 20,
);
$artists_meta_box = new WP_Query($artists_meta_box_args);
if ($artists_meta_box->have_posts()):
while ($artists_meta_box->have_posts()):$artists_meta_box->the_post();
global $post;
$artistFirstname = get_post_meta($post->ID, 'artist_firstname', true);
$artistLastname = get_post_meta($post->ID, 'artist_lastname', true);
?>
<option value="<?php echo $artistFirstname . ' ' . $artistLastname; ?>"><?php echo $artistFirstname . ' ' . $artistLastname; ?></option>
<?php
endwhile;
endif;
?>
</select>
你如何顯示下拉菜單?你有更多的代碼要展示嗎?你想如何保存選項? –
我想保存選項後刷新和使用網站上 –